Hi I would like to do the following in Matlab
Suppose I have a function which plots something
function # call 1
function # call 2
function # call 3
function # call 4
Consider that all the above functions will plot a figure in matlab window. How can I write the functions such that it will save the figure somewhere and then I can use something like this -
subplot(2,2,1), # plot for call 1
subplot(2,2,2), # plot for call 2
subplot(2,2,3), # plot for call 3
subplot(2,2,4), # plot for call 4
I do not want to save the individual figures in memory and the again load it.
A very simple function is like this :
x = linspace(0,2*pi,100);
y = sin(x);
xmarkers = 0:pi/2:2*pi; % place markers at these x-values
ymarkers = sin(xmarkers);
figure
plot(x,y,'b',xmarkers,ymarkers,'b*')
If I call this multiple times it will generate multiple figures, I want to put it into a subplot format.