Change the output format

2 views (last 30 days)
Leo
Leo on 5 Nov 2013
Commented: ES on 5 Nov 2013
I using this equation to solve for H:
L = 20;
Y = 62.4;
Q = atan(80/L);
syms H
H = solve((4000*(L^2)) + ((500*Y)/(3*((sin(Q))^2))) - ((((H/6)*Y*(L^2))+((5/3)*Y*(L^2)))*((10+(2*H))/(10+H))) - ((Y*(H^3))/6) == 0)
When I solve for H, I get an answer in this format:
H =
((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3) - 800/(3*((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3))
400/(3*((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)) - ((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)/2 + (3^(1/2)*(800/(3*((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)) + ((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3))*i)/2
400/(3*((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)) - ((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)/2 - (3^(1/2)*(800/(3*((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3)) + ((73008^(1/2)*417044942796875^(1/2))/73008 + 3923625/52)^(1/3))*i)/2
Why can't I get this answer in a simple decimal format?

Answers (1)

Walter Roberson
Walter Roberson on 5 Nov 2013
The answer given to you is the exact answer. A decimal version would be an approximation. If you want to see the approximation,
double(H)
  2 Comments
Leo
Leo on 5 Nov 2013
Where can I write that in the script so I don't have to enter it in each time I get an answer in the command window?
ES
ES on 5 Nov 2013
L = 20;
Y = 62.4;
Q = atan(80/L);
syms H
H = solve((4000*(L^2)) + ((500*Y)/(3*((sin(Q))^2))) - ((((H/6)*Y*(L^2))+((5/3)*Y*(L^2)))*((10+(2*H))/(10+H))) - ((Y*(H^3))/6) == 0);
H=double(H)

Sign in to comment.

Tags

Products

Community Treasure Hunt

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

Start Hunting!