I didn't understand the output of "y=sin(2*pi*t)" where t=[1 2 3 4 5].
Show older comments
output is 1.0e-14 *
-0.0245 -0.0490 -0.0735 -0.0980 -0.1225
i think ouput should be 0 0 0 0 0 because sin(multiple of 2*pi) is always zero.
plz help.
Answers (1)
Azzi Abdelmalek
on 19 Mar 2014
0 votes
2*pi is not stored exactly as 2*pi, but stored with some error
2 Comments
Anurag
on 19 Mar 2014
Azzi Abdelmalek
on 19 Mar 2014
each number, in Matlab or other language is stored with a certain precision, you can not store pi with an infinity of decimals. Look at
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!