Save command with full directory MATLAB 2012b

4 次查看(过去 30 天)
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

回答(1 个)

Jan
Jan 2012-10-31
编辑:Jan 2012-10-31
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.

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by