Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Candace
Posts:
13
Registered:
10/20/12
|
|
Re: save variables
Posted:
Nov 29, 2012 3:28 PM
|
|
"Steven_Lord" <slord@mathworks.com> wrote in message <k97r5d$rfg$1@newscl01ah.mathworks.com>... > > > "Candace " <jly5@duke.edu> wrote in message > news:k97oht$icm$1@newscl01ah.mathworks.com... > > Is it possible to save a variable with a specific name that is > > independently created? For example, I want the variable B to be saved as > > 'TargetS_Fixations'. > > > > B=[1 2 3 4]; > > N1='TargetS'; > > N2='_Fixations'; > > N3=strcat(N1,N2); > > > > Using the command "save N3 B" leads to variable B being saved with the > > name "N3". However, I want it to be saved with the name > > "TargetS_Fixations". > > If the name of the MAT-file to which you want to save the variable is stored > in a variable itself, use the function form of SAVE not the command form. > > save(N3, 'B') > > See the second Example from the documentation page for SAVE for a complete > example. > > http://www.mathworks.com/help/matlab/ref/save.html > > -- > Steve Lord > slord@mathworks.com > To contact Technical Support use the Contact Us link on > http://www.mathworks.com
Thanks!
|
|
|
|