t4(1)=0;Dt4=3.0e-5;for kk=2:401 t4(kk)=t4(kk-1)+Dt4;endif t4(401)==0.012 Answer='yes'else Answer='no'endif t4(401)>0.012 AnResp='yes'else AnResp='no'end
MATLAB: 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
floating pointfor loopsum
Related Question
- Problem with Less than or Equal to Operator <=
- Is this Matlab bug or error? anyone who can help
- Hii, can anyone please tell me the problem in the code ?why find doesn’t give me the index of the number in theta array thanks
- Find function in Matlab
- I have a 17658×1 double matrix. I want to find the values of indices when matrix elements are equal to k(here .1).
- How to subtract two close numbers
Best Answer