MATLAB: Unable to convert expression into double array.

unable to convert expression into double array.

syms fi ;
syms theta;
syms psi;
rM=[cos(fi)*cos(theta)*cos(psi)-sin(fi)*sin(psi) -cos(fi)*cos(theta)*sin(psi)-sin(fi)*cos(psi) cos(fi)*sin(theta) ;
sin(fi)*cos(theta)*cos(psi)+cos(fi)*sin(psi) -sin(fi)*cos(theta)*sin(psi)+cos(fi)*cos(psi) sin(fi)*sin(theta);
-sin(theta)*cos(psi) sin(theta)*cos(psi) cos(theta)];
transition=[x y z]';
hM=[rM transition ;
zeros one];

Best Answer

  • It is not clear what do you want. Your expressions are entirely symbolic. If you want to give later values to x,y,z, phi, etc try to convert hM to a MATLAB function with matlabFunction, eg
    and when you supply values for your symbolic variables you will obtain a double array