how to use two while and for loops?
Ältere Kommentare anzeigen
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
Antworten (1)
KSSV
am 7 Mär. 2021
if x < 1
statement1
elseif x >= 1
statement2
end
6 Kommentare
Engineer Batoor khan mummand
am 7 Mär. 2021
Engineer Batoor khan mummand
am 7 Mär. 2021
Bearbeitet: Engineer Batoor khan mummand
am 7 Mär. 2021
KSSV
am 7 Mär. 2021
[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
am 7 Mär. 2021
Engineer Batoor khan mummand
am 7 Mär. 2021
Engineer Batoor khan mummand
am 7 Mär. 2021
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!