Search code examples
matlabsymbolic-math

Matlab double() returning 0 for sym


Here is the code that is giving me trouble.


>> x_flex

x_flex =

sigma == 140512308373959475200/8004146304532579

>> double(x_flex)

ans =

     0

Where x_flex is a 1x1 sym.

What I want is for matlab to do the division and return a number in this case: 1.7555e+04.


Solution

  • solving x_flex for sigma seems to do make it work:

    x_flex =
    
    sigma == 140512308373959475200/8004146304532579
    
    >> solve(x_flex)
    
    ans =
    
    140512308373959475200/8004146304532579
    
    >> double(ans)
    
    ans =
    
       1.7555e+04