I didn't understand the output of "y=sin(2*pi*t)" where t=[1 2 3 4 5].

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)

2*pi is not stored exactly as 2*pi, but stored with some error

2 Comments

I didn't get you..can you please explain.
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

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 19 Mar 2014

Commented:

on 19 Mar 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!