Is there anybody to help me fix the error and convert mxArray to double?
14 次查看(过去 30 天)
显示 更早的评论
I am trying to implement the m-file into Matlab Function in Simulink. It needs to run some code conversion. Since "care()" function is not in the main library of this code converter, I have added coder.extrinsic('care'). Now when I run the Simulink it shows me the error as in the attached figure.
coder.extrinsic('care')
[~,~,G0] = care(hA, hB2, eye(4), eye(1), zeros(4,1), E);
KK=G0;
bA=hA-hB2*KK;
Now in my case bA(4x4 matrix), hB2(4x1 double), KK(1x4 mxArray). In fact after multiplication bA*hB2 should return 4x4 matrix. The problem is that KK should be double in order to work. How can I fix this issue of converting mxArray to double?
The code runs ok on m-file, but when I try to implement it on Simulink, it doesn't. I plan later to convert it to C++ code.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!