restricting the number between limits

조회 수: 1 (최근 30일)
Offroad Jeep
Offroad Jeep 2015년 9월 9일
답변: Hamoon 2015년 9월 9일
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

답변 (1개)

Hamoon
Hamoon 2015년 9월 9일
insert this into for loop:
if (value > 0) && (value < 1)
break;
end

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by