Why doesn't the less than operator work inside a for loop for decimals
Mostrar comentarios más antiguos
Im trying to get the following code to work. but every time the value of x goes below 0.6 even though it an if condition is set to prevent it..can someone help
x=0.8;
for n=1:10
if (x>0.6)
x=x-0.1;
end
x
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical 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!