Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
saving variables

Subject: saving variables

From: Jessica

Date: 22 Jul, 2010 17:00:28

Message: 1 of 2

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.

Subject: saving variables

From: Andy

Date: 22 Jul, 2010 17:15:21

Message: 2 of 2

"Jessica" <jyorzinski@ucdavis.edu> wrote in message <i29tfc$db3$1@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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us