Unexpected for loop behaviour
Show older comments
This for loop is supposed to run for 2 iterations i.e. for i=0 and i=-0.1 as variable outputOverVoltageChange_65 = -0.1. Why is it running for only i=0?

2 Comments
Renato SL
on 9 Jul 2019
I assume you post this question because in the output you get, there is only 1 set of entry but you expect 2.
So, can you post a screenshot/photo of the output and highlight the fact that there is only 1 entry there?
Thank you.
Walter Roberson
on 9 Jul 2019
Your variable is not exactly what you think it is, or 0:-0.1:something does not generate exactly the values you expect. Remember that 0.1 cannot be exactly represented in binary floating point.
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!