MATLAB: Gui takes prettty much time for launching

gui

hi, In my gui i have a images slideshow and some text its working right but the problem is gui takes pretty much time for launching and when i comment images slideshow code it get start quickly… now how to resolve this issue?

Best Answer

You can use following code to run slideshow because it will run in background.
function slideshow
global indx
indx=1;
showTimer=timer('timerFcn',@timefcn);
set(showTimer,'ExecutionMode','fixedRate');
start(showTimer)
function timefcn(varargin)
global indx
imgNameList= char('1.jpg','2.jpg','3.jpg');
a=imread(imgNameList(indx,:));
indx=indx+1;
if indx>10
indx=1;
end
imshow(a);
drawnow;
Related Question