Unable to convert expression into double array.

5 visualizaciones (últimos 30 días)
Andrea Gusmara
Andrea Gusmara el 25 de Abr. de 2020
Comentada: Andrea Gusmara el 25 de Abr. de 2020
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]';
zeros=sym(zeros(1,3));
one=sym(ones(1));
hM=[rM transition ;
zeros one];
hM=double(hM);

Respuesta aceptada

Radu Trimbitas
Radu Trimbitas el 25 de Abr. de 2020
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
hMf=matlabFunction(hM);
and when you supply values for your symbolic variables you will obtain a double array
  1 comentario
Andrea Gusmara
Andrea Gusmara el 25 de Abr. de 2020
Yes I want to obtain a double expression from my symbolic hM. I have just tried to apply your advice and my program works correctly . I want to ask you another question , is it the only possible solution for update my simbolic expressions?. thanks for your help .

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by