Double command does not work when converting 1*1 sym variable to a numerical value. What will work?
Afficher commentaires plus anciens
I am having trouble converting my unknown variables, solved using the symbolic toolbox(a_1,a_2,a_3), into numerical values. the error i get is
Error using symengine (line 59)
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
Error in sym/double (line 583)
Xstr = mupadmex('symobj::double', S.s, 0);
Heres my code:
Th_final= sym('Th_start+a_1*T*f^5+a_2*T*f^4+a_3*T*f^3')
Vel_final=sym('0== 5*a_1*T*f^4+4*a_2*T*f^3+3*a_3*T*f^2')
Acc_final=sym('0==20*a_1*T*f^3+12*a_2*T*f^2+6*a_3*T*f')
answer=solve(Th_final,Vel_final,Acc_final,'a_1','a_2','a_3');
Th_final=double(answer.a_1)
Th_final1=double(answer.a_2)
Th_final3=double(answer.a_3)
This is probably a very simple question but what command can i use to return numerical values of a_1,a_2,a_3?
Thanks
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!