Why are these sums not the same?
Show older comments
Hello together,
What is the difference between these two:
1:
>>sum(cos(0.5*pi)*(0:99))
ans =
3.0310e-13
and 2:
>>S=0;
>> for J=0:99
S=cos(0.5*pi)*j;
end;
>> S =
6.0620e-15
Why is there a different result?
Thank you for any help!
Accepted Answer
More Answers (1)
Image Analyst
on 16 Jan 2015
0 votes
Categories
Find more on Matrix Indexing 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!