Compare values from for loop
Mostrar comentarios más antiguos
Hello, I just experienced something weird (at least something I wouldn't have expected):
for m=0.4:0.2:1.2
if (m == 0.6)
a = 2;
end
end
Now even if my m is assigned to 0.6 the if condition will give 0. Why is that and how can I avoid that?
Thanks, Paul
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!