Matlab (R2015a) seems to be computing wrongly a simple recurrent sum. Below is a simple code that shows it. I get that Answer='no', AnResp='yes' however t4(401)=0.012. Does anyone have an idea of what is going on here?
Show older comments
t4(1)=0;
Dt4=3.0e-5;
for kk=2:401
t4(kk)=t4(kk-1)+Dt4;
end
if t4(401)==0.012
Answer='yes'
else
Answer='no'
end
if t4(401)>0.012
AnResp='yes'
else
AnResp='no'
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!