accuracy n precision
古いコメントを表示
what do i do so that the result of cos(pi/2) is zero?
採用された回答
その他の回答 (1 件)
UJJWAL
2011 年 9 月 26 日
Hi
The problem with MATLAB is its precision in these cases. You can try like this .
cosd(x * (180/pi));
% Where x is the angle in radians
This will give you the correct result.
For example when x = pi/2 then cosd (pi/2 * 180/pi) = 0
カテゴリ
ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!