how to use "or"
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Max Müller
le 5 Août 2014
Réponse apportée : Andrei Bobrov
le 5 Août 2014
Can u pls tell me what is wrong ( just an example) How do i use the or command ?
for i = 1:100
if i == 2|5
disp('hallo')
end
end
0 commentaires
Réponse acceptée
Plus de réponses (1)
Andrei Bobrov
le 5 Août 2014
for ii = 1:100
if ii == 2 || ii == 5
ii
disp('hallo')
end
end
or
for ii = 1:100
if ismember(ii,[2,5])
disp('hallo'),ii
end
end
0 commentaires
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!