I am trying to store matrices produced in a for loop before it get overwritten by the next iteration. The problem is the matrix size is that of an image while my loop limits is just from 1 to 9. What should I do knowing that I cannot use the cell command and put it in the loop limit?

2 comentarios

Azzi Abdelmalek
Azzi Abdelmalek el 3 de Jun. de 2016
Show us your code
M
M el 3 de Jun. de 2016
Editada: per isakson el 3 de Jun. de 2016
for k=1:9
I=sprintf('',k)
J=imread(I)
end

Iniciar sesión para comentar.

 Respuesta aceptada

Geoff Hayes
Geoff Hayes el 3 de Jun. de 2016
M - why can't you use a cell array to store the images?
myImages = cell(9,1);
for k=1:9
I=sprintf('',k); % is this supposed to be the name of a file? what is the extension?
J=imread(I);
myImages{k} = J;
end
You seem to be missing the file extension for your image though...

1 comentario

M
M el 3 de Jun. de 2016
I think my error was in the type of brackets. Thank you very much.

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:

M
M
el 3 de Jun. de 2016

Comentada:

M
M
el 3 de Jun. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by