Nate Parsons
Nate Parsons

Reputation: 14901

Matlab Fraction to Floating Point

After using the 'solve' function on an equation with one variable, it seems like Matlab doesn't like using floating point. So, my answer is

ans = -2515439103678008769411809280/29019457930552314063110978530889-1/232155663444418512504887828247112*13479465975722384794797850090594238631144539220477565900842902305^(1/2)

and I'm not sure what the best way to convert it to an understandable decimal is. The best way I have so far is

eval(char(ans))

(which gives me -0.5002 for those keeping track), but I'm not really happy with that solution.

Can anyone suggest something better?

Upvotes: 0

Views: 4254

Answers (1)

Nate Parsons
Nate Parsons

Reputation: 14901

Well, the very next page I looked at had the answer. It's the 'double' function:

double(ans)

Upvotes: 1

Related Questions