Ho do i convert this number to an integer?
1 回表示 (過去 30 日間)
古いコメントを表示
I'm using this code to solve an equation.
syms b
w=1150;di=32.59;do=23.44;
sol=solve((w-(2.*90.*sind(b))).^2==(w-(90.*sind(b+di))-(90.*sind(b-do))).^2+((90.*cosd(b-do))-(90.*cosd(b+di))).^2,b);
vpa(sol)
I'm solving for b and im supposed to get around 28.1606 but im getting
ans =
144.93095960237559740993061817135 + 177.92191183196224178797359740301i
Why am i not gettin gthe answer? Do i have to onvert it?
0 件のコメント
採用された回答
Birdman
2020 年 3 月 24 日
Try vpasolve:
w=1150;di=32.59;do=23.44;
sol=vpasolve((w-(2.*90.*sind(b))).^2==(w-(90.*sind(b+di))-(90.*sind(b-do))).^2+((90.*cosd(b-do))-(90.*cosd(b+di))).^2,b)
vpasolve solves the equation numerically.
11 件のコメント
Birdman
2020 年 3 月 24 日
Replace the line
sol=vpasolve((w-(2.*90.*sind(b))).^2==(w-(90.*sind(b+di(i)))-(90.*sind(b-do(i)))).^2+((90.*cosd(b-do(i)))-(90.*cosd(b+di(i)))).^2,b);
with
sol(i)=vpasolve((w-(2.*90.*sind(b))).^2==(w-(90.*sind(b+di(i)))-(90.*sind(b-do(i)))).^2+((90.*cosd(b-do(i)))-(90.*cosd(b+di(i)))).^2,b);
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!