how to use two while and for loops?
이전 댓글 표시
hi to all:
i have two condition in my problem in matlab.
(1) matlab should run the first statement when x<1 .
(2) when x reaches to x>1 or x=1 the matlab should run the second statement.
thanks from all of you
답변 (1개)
KSSV
2021년 3월 7일
if x < 1
statement1
elseif x >= 1
statement2
end
댓글 수: 6
Engineer Batoor khan mummand
2021년 3월 7일
Engineer Batoor khan mummand
2021년 3월 7일
편집: Engineer Batoor khan mummand
2021년 3월 7일
KSSV
2021년 3월 7일
[m,n] = size(x) ;
for i = 1:m
for j = 1:n
if x(i,j) < 1
statement1
elseif x(i,j) >= 1
statement2
end
end
end
Engineer Batoor khan mummand
2021년 3월 7일
Engineer Batoor khan mummand
2021년 3월 7일
Engineer Batoor khan mummand
2021년 3월 7일
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!