Why do i get an error with coder.extrinsic?
Show older comments
Hi,
I have very complicated matrices and vectors which consist of "dirac". To run dirac command in SIMULINK, i use coder.extrinsic('dirac'), nevertheless my block cannot work. SIMULINK gives an error:
Expected either a logical, char, int, fi, single, or double. Found an mxArray. MxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may only be used on the right-hand side of assignments and as arguments to extrinsic functions.
Function 'MMM' (#228.1467.1878), line 11, column 1172:
"0.027696559278073379663632195329385*dirac(tan(beta - (1.0*lr*yaw_angle)/v_x) - 0"
Launch diagnostic report.
My code:
function [A_delta,B_delta,C_delta,D_delta] = fcn(u,beta, w_z, yaw_angle, lat_pos,mu_road,v_x,m_total,lf,lr,J_z)
coder.extrinsic('dirac');
A_delta = (zeros(4,4))
B_delta = (zeros(4,1))
C_delta = (zeros(1,4))
D_delta = 0;
A_delta = % 4 x 4 matrix, it is too long to write here. Some of the lines have dirac commands like above.
B_delta = % 4 x 1 vector
C_delta = %1 x 4 vector
D_delta = 0
Accepted Answer
More Answers (0)
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!