setting the position of an image in a figure?

14 Ansichten (letzte 30 Tage)
alex
alex am 15 Okt. 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 Kommentare
Björn
Björn am 15 Okt. 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 am 15 Okt. 2012
Bearbeitet: alex am 15 Okt. 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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 15 Okt. 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.

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by