MATLAB: How to save plots so that they are in the same graph for different conditions

MATLABplot

Hi,
I need to generate plots for four different conditions. So I will be having four curves on the whole. Now I get a plot for the first condition, and when I change the condition, I obviously get a different plot but I need to make the first plot remain in the same graph. Similarly for the third and fourth graphs (or conditions).
Please someone tell me how to do this. I have tried the 'hold on' command, nothing happens.
Thanks.

Best Answer

See the documentation on subplot. It will give you as many plots as you want in the same figure.
If you want them all in the same set of axes, and hold did not work, post your code so we can see what you did and what the problem is.
Later, with posted code available...
One problem is that you’re not telling it to plot the correct vector. See if changing the plot command to:
plot(s_x_index, f_x_save, 'x')
improves things.