setting the position of an image in a figure?

14 views (last 30 days)
alex
alex on 15 Oct 2012
I have this small loop, that shows a 'text' UIcontrol . after a small pause it I change the text's visiblty, and want to load an image instead..
I use
while ii<num_of_rounds
set(a7,'Visible','on');
pause(plus_time);
set(a7,'Visible','off');
axes('Position',[.35 .3 .3 .3]);
image(imcell{1,b});
START_TIMER;
end.
I have two problems here-
1. matlab tells me that the
axes('Position',[.35 .3 .3 .3]);
takes too long and I should take it out from the loop- how can I do it, while still haveing the image in that position and without opening a new figure ( in an exsisting GUI)?
  2 Comments
Björn
Björn on 15 Oct 2012
I would assume that the while-counter 'ii' should occur in the loop to make sure that the while-loop stops at a certain time. If it is just a single figure you want to plot, then I would think there is no need for a loop. Can you give a little more of the code so it can be more clear what happens in the loop?
alex
alex on 15 Oct 2012
Edited: alex on 15 Oct 2012
just change the directories and put some jpg photos and it will work (there are still other problems) you will find the loop in line 102.. its not a while loop but it does'nt matter

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 15 Oct 2012
Don't worry about it. The time is inconsequential. One thing to note is that your repeated calls to image stack up a bunch of images in the axes control so this loop will slow down as it goes. Put in a "cla" before "image" to clear out prior images. You might actually need the Position resizing code in there if it automatically resizes the control for each new image (which it will do unless you've set "hold on"), and you don't want that.

Community Treasure Hunt

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

Start Hunting!