how to use two while and for loops?
Afficher commentaires plus anciens
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
Réponses (1)
KSSV
le 7 Mar 2021
if x < 1
statement1
elseif x >= 1
statement2
end
6 commentaires
Engineer Batoor khan mummand
le 7 Mar 2021
Engineer Batoor khan mummand
le 7 Mar 2021
Modifié(e) : Engineer Batoor khan mummand
le 7 Mar 2021
KSSV
le 7 Mar 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
le 7 Mar 2021
Engineer Batoor khan mummand
le 7 Mar 2021
Engineer Batoor khan mummand
le 7 Mar 2021
Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!