Prevent Overwrite Image in loop

2 次查看(过去 30 天)
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 个评论
Magdy Saleh
Magdy Saleh 2018-8-7
You are overwriting the image variable at every iteration of the loop
Ashley Lewis
Ashley Lewis 2018-8-7
Ok thanks! Any way I can avoid this?

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2018-8-7
编辑:Stephen23 2018-8-7

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by