setting the position of an image in a figure?

13 次查看(过去 30 天)
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 个评论
Björn
Björn 2012-10-15
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 2012-10-15
编辑:alex 2012-10-15
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

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2012-10-15
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.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by