MATLAB Answers


Display images in Gui axes

Asked by Straton
on 6 May 2013

Hello, I am relatively a new matlab user and a programmer generally. I have created a GUI and I want to display the results of the program on the gui. The results are images, which come from a table Image(i). I added 20 axes on my gui to print the 20 first images of this table. The axes are called im1,im2...im20. How could I do a for loop to display each image on each axes respectively? Is it possible to handle the string im1, so it will be like imi and every time i increases it will become im1,im2 etc.? Thanks in advance



No products are associated with this question.

1 Answer

Answer by Jan Simon
on 6 May 2013
 Accepted answer

See: FAQ: How to create variables A1, A2, ... in a loop

Summary: Don't do this. Use an index instead like im(1), im(2), .... Then using a loop is trivial.

  1 Comment

Thank you. Even though I solved it a few minutes ago, your solution is simple and clever. Thanks!

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!