Unexpected for loop behaviour
Mostra commenti meno recenti
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 Commenti
Renato SL
il 9 Lug 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
il 9 Lug 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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Programming in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!