From: ShilpaSY on
hey all,,
if i have 'n' number of graphs plotted for same x and y variable, also
the scale of both axis is same.
is there any way in matlab so that i can combine these all graphs into
one?

Also can i retain any variable in matlab between successive runs?
(there is mlock for a file, like this is there anything to retain a
variable)
From: Steven Lord on

"ShilpaSY" <shilpa.yadahalli(a)gmail.com> wrote in message
news:c469b223-e876-4dff-829c-4550b54f5041(a)m26g2000yqb.googlegroups.com...
> hey all,,
> if i have 'n' number of graphs plotted for same x and y variable, also
> the scale of both axis is same.
> is there any way in matlab so that i can combine these all graphs into
> one?

Get the handles of the lines (either by specifying an output argument when
you call PLOT or LINE or whatever graphics command you used to create the
plots) and use COPYOBJ to copy them into the same axes.

> Also can i retain any variable in matlab between successive runs?
> (there is mlock for a file, like this is there anything to retain a
> variable)

I think what you're asking is "Can I keep the value of a variable in a
function the same each time I run it?" and the answer is yes, either by
using a PERSISTENT variable or by returning it from the function and passing
it back into the function the next time you call it. Alternately, if you're
using an object you could store the value in a property of that object.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ