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

 Respuesta aceptada

the cyclist
the cyclist el 5 de Ag. de 2014

0 votos

for i = 1:100
if (i == 2)|(i == 5)
disp('hallo')
end
end

Más respuestas (1)

Andrei Bobrov
Andrei Bobrov el 5 de Ag. de 2014

0 votos

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

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 5 de Ag. de 2014

Respondida:

el 5 de Ag. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by