Why function "care" doesn't work when used in function that is called from Simulink?

6 次查看(过去 30 天)
Hello guys,
I am trying to solve an Algebraic Riccati Equation in Simulink. I have used a Matlab Function block in simulink in which I am trying to solve the ARE. But I get this error
"The function 'care' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation." Does anyone know how to solve this problem?
Thanks in advance. Cheers,
Ethen

回答(2 个)

Andrew Schenk
Andrew Schenk 2015-3-3
Only a subset of MATLAB functions support C/C++ code generation. An alphabetical list of supported functions is located here: http://www.mathworks.com/help/coder/ug/functions-supported-for-code-generation--alphabetical-list.html
Notice that the function "care" is not present in this list.
You can still run MATLAB in "Normal" mode using the function "care", but if you attempt to use "Rapid Accelerator" mode or compile the Simulink model using the Simulink Coder you will encounter the error message you have given.

Rohollah Moghadam
编辑:Rohollah Moghadam 2019-8-9
Use the following code in your Matlab Function block in Simulink, before using 'care' function.
coder.extrinsic('care');
Note: The question is for long time ago. I hope this would be useful for who have same problems.

类别

Help CenterFile Exchange 中查找有关 Matrix Computations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by