more for loop help

for c = 11:20
if c~=11 && c~=14 && c~=17 && c~=20
break
end
% how can I loop through for all values of r, which are r=11,14,17,20????
end

Respuestas (2)

bym
bym el 7 de Ag. de 2011

0 votos

for k = 11:3:20
%do stuff
end
Walter Roberson
Walter Roberson el 7 de Ag. de 2011

0 votos

Or you could use
for k = [11,14,17,20]
%do stuff
end

La pregunta está cerrada.

Etiquetas

Preguntada:

el 7 de Ag. de 2011

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by