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!