I need to find out what this program is missing
古いコメントを表示
I'm trying to use this program to calculate the cos of a given(prompted) angle in degrees.
A=input('Enter angle:');
x=(pi/180)*A;
format long
a=0;c=0;sg=1;
while
c=c+sg*((x^(2*a))/(factorial(2*a))); % Infinite series calculation.
a=a+1;sg=-sg;
end
fprintf('cos = %6f',c);
I get no answer and I have to close Matlab and restart.
4 件のコメント
Yash
2012 年 7 月 12 日
what error did u got?
Aaron
2012 年 7 月 12 日
Albert Yam
2012 年 7 月 12 日
If you are stuck in a loop. (See 'Busy' in the bottom left.) hit Ctrl+C
Ryan
2012 年 7 月 12 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!