Prevent Overwrite Image in loop

I am trying to load all 16 images. When I run my code now, Only the last image is saved and can be displayed. Even when I include "loadedimage= imread(Image)" and "imshow(loadedimage)" in the for loop this still occurs. Thanks for any help!
for k=1:16 fileName = strcat('image',num2str(k),'.bmp'); Image= char(fileName); end loadedimage= imread(Image); imshow(loadedimage)

2 comentarios

Magdy Saleh
Magdy Saleh el 7 de Ag. de 2018
You are overwriting the image variable at every iteration of the loop
Ashley Lewis
Ashley Lewis el 7 de Ag. de 2018
Ok thanks! Any way I can avoid this?

Iniciar sesión para comentar.

 Respuesta aceptada

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 7 de Ag. de 2018

Editada:

el 7 de Ag. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by