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!