Hello all. I have a problem with rendering my image in GUI. I'm trying to creat a automatic simulation of crossroad with traffic lights. First of all I need to move with cars, which I load as a image to GUI. The problem is that when the for loop starts rendering image of the car(Image number 1), it does not delete the former images which is unacceptable (image number 2). Can anyone help me with this, please?
clcclearI=imread('C:\Users\Miroslav\Desktop\Crossroad\cross_matl.png');hi = imagesc(I)hold oncar=imread('C:\Users\Miroslav\Desktop\Crossroad\blue_car3.png');Nt=10; % Number of time steps
xval=450;ymin=900;ymax=-75;y=linspace(ymin,ymax,Nt);for it=1:Ntimagesc('CData',car,'XData',[450],'YData',[y(it)])pause(1);end
Best Answer