CVX and Simulink Problem


(Mohamed Abdelaal) #1

Hello,
I’m trying to use cvx for a SDP online optimization , i write the code in an embedded matlab function but when i run the simulink file, i got the following error:
Function ‘iscellstr’ is not supported for code generation. Consider adding coder.extrinsic(‘iscellstr’) at the top of the function to bypass code generation.

cvx_begin:
Function ‘iscellstr’ is not supported for code generation. Consider adding coder.extrinsic(‘iscellstr’) at the top of the function to bypass code generation.

cvx_begin:
Cannot load ‘cvxprob’ because code generation does not support classes and enumerations in @-directories.

Note: The same code works fine if i run the m file outside simulink and i added coder.extrinsic(‘iscellstr’) in both cvx_begin and my embedded matlab function but nothing change.

Thanks for help


CVX in Simulink MATLAB function block
(Michael C. Grant) #2

I’m sorry to say that we don’t support any of MATLAB’s code generation facilities. I’m pleased to hear that it’s working for you with the workaround, but I cannot promise you will not run into any problems otherwise.


(Praveen Kumar Nambisan T M) #3

Hi,

Did you find any solution for the same? i.e to use the cvx m-file in a matlab function in simulink?


(Praveen Kumar Nambisan T M) #4

Hi,

Does CVX support code generation to use in Matlab function in Simulink? I have tried and got many errors.

Since the optimization is working fine in usual matlab m-file environment. Is there any way to integrate the code to run with a simulink project? I am trying to use it for real-time optimization.

Thanks for any valuable inputs.