figure1_handle = figure('Visible','off');
subplot(1,2,1);
imshow(I);
x = 1:1:10;
y = x;
plot(x,y,'kx','MarkerSize',10,'LineWidth',2);
subplot(1,2,2);
imshow(I);
x = 10:1:20;
y = x;
plot(x,y,'kx','MarkerSize',10,'LineWidth',2);
Ichanged = getframe(figure1_handle); % this line makes the figure visible which is not wanted here, any solution to keep this figure invisible while exporting data into workspace?
figure;imshow(Ichanged); % testing if the figure 2 is similar to that of figure 1