From: Jessica on
Is it possible to save variables with specific names?

For example, I have a variable and save it with:

save results2

This results in a file called results2.mat.

Is it possible to specify the name of what I want this to be called, such that it could be saved as

new23.mat.

This would not be as simple as just typing new23=results2; because I am looping through files and the name I would want to save it as should change with each loop.
From: Andy on
"Jessica" <jyorzinski(a)ucdavis.edu> wrote in message <i29tfc$db3$1(a)fred.mathworks.com>...
> Is it possible to save variables with specific names?
>
> For example, I have a variable and save it with:
>
> save results2
>
> This results in a file called results2.mat.
>
> Is it possible to specify the name of what I want this to be called, such that it could be saved as
>
> new23.mat.
>
> This would not be as simple as just typing new23=results2; because I am looping through files and the name I would want to save it as should change with each loop.

Did you read the documentation for save? It discusses this in detail:

doc save