|
"Think two, count blue." <roberson@hushmail.com> wrote in message <ikm89s$ood$2@nrc-news.nrc.ca>...
> On 11-03-02 01:32 PM, Jonathan wrote:
> > I have the following script for automatically saving .mat files...
> >
> > fname=sprintf('Rck%d',i); % where i varies numerically reflecting different
> > files of interest
> > save([fname '.mat']);
> >
> > The problem I'm having is that this saves all variables. What I can't figure
> > out how to do is the correct format for saving a single variable. Doing it
> > manually its as simple as:
> > save *.mat variable
> >
> > I tried various combinations using the initial approach but none seem to work.
> > Any help would be much appreciated.
>
> save([fname '.mat'], 'variable');
Thanks, this worked.
|