How to use not equal in for loop

조회 수: 14 (최근 30일)
Kaiyu Nie
Kaiyu Nie 2020년 8월 10일
편집: James Tursa 2020년 8월 10일
Is it possiable to use ~= in for loop like
for t ~= 1
xxx
xxx
xxx
end

답변 (1개)

James Tursa
James Tursa 2020년 8월 10일
편집: James Tursa 2020년 8월 10일
You could use a while loop. E.g.,
t = 0;
while( t ~= 1 )
% code
% at some point, either set t=1 or break out of loop
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by