restricting the number between limits

1 visualización (últimos 30 días)
Offroad Jeep
Offroad Jeep el 9 de Sept. de 2015
Respondida: Hamoon el 9 de Sept. de 2015
clc
clear all
a = 10
b = rand(1)
nmc = 100
for i = 1:nmc
c = a - b
if c < a
a = c
else
a = a
end
end
I want to stop the code when value is between 1 and 0 kindly guide

Respuestas (1)

Hamoon
Hamoon el 9 de Sept. de 2015
insert this into for loop:
if (value > 0) && (value < 1)
break;
end

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by