Reputation: 497
I want to save the value of a variable from MATLAB command history in a text. I am trying the command:
Save([d:/work/abc.txt], 'z1', '-ASCII');
An error appears
Error: input charecter is not valid in MATLAB environment or expression.
Upvotes: 1
Views: 326
Reputation: 36
What you are missing are the quotes within the brackets for denoting string.
['string']
Upvotes: 2
Reputation: 5190
You should use save
(with lower case for "s").
Also the filename should be defined as a string: enclose it withi two '; also you do not need the []
unless, for example, you want to build a string using a variable and / or any function to create part of the filename (e. g.
['d:/work/abc_' num2str(k) '.txt']
assuming k
value is 3
) to get d:/work/abc_3.txt
Try change your code to:
save(['d:/work/abc.txt'], 'z1', '-ASCII');
Hope this helps.
Qapla
Upvotes: 2