Change the output format

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?

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 11 月 5 日

0 投票

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 件のコメント

Leo
Leo 2013 年 11 月 5 日
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 2013 年 11 月 5 日
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)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

製品

タグ

質問済み:

Leo
2013 年 11 月 5 日

コメント済み:

ES
2013 年 11 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by