Save command with full directory MATLAB 2012b
4 views (last 30 days)
Show older comments
An error seems to occur with the save command when using it when choosing a filename with the full directory attached. Has this always happened or is this a new problem with MATLAB 2012b?
e.g. The following works fine:
save Test.mat VarA VarB
The following recieves an error:
save c:\Documents and Settings\TheUserName\Desktop\MyFolder\Test.mat VarA VarB
The error recieved is:
Error using save
Variable ' and' not found
0 Comments
Answers (1)
Jan
on 31 Oct 2012
Edited: Jan
on 31 Oct 2012
The non-functional form of save causes troubles again and again. So better use the functional form:
save('c:\Documents and Settings\TheUserName\Desktop\MyFolder\Test.mat', ...
'VarA', 'VarB');
Lucas' version works in all Matlab version I know, but the smart conversion of the arguments of the non-functional form is not documented and changes between Matlab versions. Sometimes numbers are assumed to be strings, sometimes they are numbers, etc.
0 Comments
See Also
Categories
Find more on Whos in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!