Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: save specified variables in a sequence of file names
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Guest

Watch Watch this User
save specified variables in a sequence of file names
Posted: Feb 21, 2013 7:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I would greatly appreciate any help I can get with the following:

>> save f1
Saves all workspace variables in f1.mat, as expected.

>> save f1 a
Saves only variable a in f1.mat, as expected.

>> n = 1; save ['f' num2str(1)]
Saves all workspace variables in f1.mat, as expected.

>> n = 1; save ['f' num2str(1)] a
Saves only variable a in a file whose name is ['f' num2str(1)]!!!

Is there any way to save a series of files whose file names are created dynamically, with different variables saved in different files?

I searched the FAQs and the posts in this news group but could not find a solution.

Thanks

Iz



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.