please explain this statement for img = 1:s(1)

which type of for loop is this ? please explain the below statement.Thanks in advance.
for img = 1:s(1)

 Respuesta aceptada

KSSV
KSSV el 17 de Nov. de 2016
s should be array which is already defined. It is a for loop which runs from 1 to s(1).
Eg:
s = [5 6 7 8] ;
for img = 1:s(1)
img
end

4 comentarios

Kanwal Kaur
Kanwal Kaur el 17 de Nov. de 2016
that means it will run from 1 to first element of array ?is it so ?
KSSV
KSSV el 17 de Nov. de 2016
Yes...the first element is 5, it will run from 1 to 5.
Kanwal Kaur
Kanwal Kaur el 17 de Nov. de 2016
ok.Thanks :)
KSSV
KSSV el 17 de Nov. de 2016
Thanks is accepting the answer....;)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Nov. de 2016

Comentada:

el 17 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by