I want to show image and plot in the loop. I want to show image in one figure and plot in other figure. So I try to use my code, but it does not work. Could you help me fix it? Thanks so much
x=0;
x_arr=[]
I=imread('peppers.png');
figure
for i=1:100
if mod(i,10)==0
pause(0.5);
x=i.^2+1;
x_arr=[x_arr x]
%show image
hold on
imshow(I);
hold off
%show plot
pause(0.5);
hold on
plot(y_arr);
hold off
end
end
figuredocumentation. Also, take a look at this question/answer on How can I specify to which figure a plot should go?