I want to convert from symbolic variable to double variable . but i can't, help me.
Afficher commentaires plus anciens
>result=feval(symengine, 'solve', '[x+3*y-8=0,2*x-5*y+52=0]')
>result = [x == -116/11, y == 68/11]
>X = double(result(1,1))
>Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in sym/double (line 702)
Xstr = mupadmex('symobj::double', S.s, 0);
i want to input "x == -116" to "X" which is double variable, and i have to use Mupad command. how do i convert from symbolic variable to double variable?
when i use a "solve" command, i get a symbolic value which was calculated to use "S.x" command.(S is struct, x is symbolic). when i use Mupad command, i could't use this method. i have to use script file so i have to find a solution to one's problem.
thank you.
Réponse acceptée
Plus de réponses (1)
bym
le 18 Mai 2012
I too am confused, but maybe this will help:
syms x y
result = solve(x+3*y-8,2*x-5*y+52)
result =
x: [1x1 sym]
y: [1x1 sym]
double(result.x)
ans =
-10.5455
Catégories
En savoir plus sur Conversion 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!