If-statement do not respond
古いコメントを表示
Hei! I am running the following function in matlab:
function trig(a,b)
format long
x=pi/9;
a=sin(4*x)
b=4*sin(x)*cos(x)-8*sin(x).^3*cos(x)
if (a==b)
disp('verified')
end
After calculating variables "a" and "b" I got the following values a=0.984807753012208 and b=0.984807753012208 (a=b). The problem is that my if-statment do not display "verified" after running a script. But if I type "if (a<b)" I do get 'verified'. Why is it so?
Thank you in advance.
1 件のコメント
Stephen23
2015 年 7 月 13 日
These will be useful to read and understand:
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!