Inexplicable behavior of SAVE command
Show older comments
Hi, I have qestion about SAVE command behavior in GUI. In my GUI I use command:
save rotor_spec; %works fine...saves all variables to rotor_spec.mat
But today I tried make option for user to choose name for the file, not only rotor_spec.mat; I used this:
name = uiputfile('*.mat')
save name; % or save('name')
And it does not work. I do not realy need this for my GUI, but I would like to know, why it does not work.
Accepted Answer
More Answers (1)
Try:
save( name )
I think the
save name
without the parenthesis only works if name is an absolute string, not a variable e.g.
save 'MyFile.mat'
though I may be wrong.
2 Comments
John D'Errico
on 18 Dec 2014
save name
DOES do something. It DOES work, just that it does something you may not expect. See my answer. This is due to having used the command form of save, as opposed to using the function form of save.
Jiri Franc
on 18 Dec 2014
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!