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!