My loop can't (sometimes...) evaluate its variable

Hello,
I have a problem with a program : It was working yesterday, but this morning it didn't anymore... The same problem also happens with a very basic code :
F=0.32;
for x=-0.5:0.01:0.5
if x==F
disp(x)
end
end
For F=0.32 it doesn't disp the value (even if i write 'x" instead of "disp(x)" etc). For F=0.28, it does work... Not for F=0.29.
I'm a bit lost, did I use something wrong ?
Thank you for your help !

 Akzeptierte Antwort

Stephen23
Stephen23 am 25 Mär. 2021
Bearbeitet: Stephen23 am 25 Mär. 2021

0 Stimmen

1 Kommentar

Floriane A
Floriane A am 25 Mär. 2021
Thank you very much for your answer.
I wasn't enough aware of that... I'll read this documentation, thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Produkte

Version

R2018a

Tags

Gefragt:

am 25 Mär. 2021

Kommentiert:

am 25 Mär. 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by