Unexpected for loop behaviour
古いコメントを表示
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 件のコメント
Renato SL
2019 年 7 月 9 日
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
2019 年 7 月 9 日
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!