The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: create new variable name and save worksapce with it
Replies: 3   Last Post: Dec 24, 2010 7:17 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 140
Registered: 6/23/09
Re: create new variable name and save worksapce with it
Posted: Dec 24, 2010 7:17 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Ilham Hardy" wrote in message <if20l0$std$>...
> "ben harper" wrote in message <if1rg0$nd$>...
> > i have three variables in workspace "x","y","z"
> >
> > i change test number regarding to my scenario
> > variable name is "testno"
> >
> > when testno=2
> > i want to save x,y,z variables
> > to a file called testno2.mat
> >
> > when i change it to testno=447
> > save these variables to testno447.mat
> >
> > how can i do? thank you

> HI,
> Please try,
> file_name = testno
> save(file_name, format, '-mat')
> HTH,
> Ilham

i solved this issue like this:

save(['test',num2str(testno),'.mat'], 'x', 'y', 'z')

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.