不用那么复杂。如果要输出的变量不太多的话可打开变量,然后全选,再打开excel文件粘贴即可,很简单。如果比较多的话可以先把变量输出为ASCII(txt)文件,然后在excel中导入。
如要将变量a 存成到当前目录下的b.txt文件,可用:save 'b.txt' a -ascii。还有其它参数可参考matlab 的帮助。
SAVE Save workspace variables to disk.
SAVE FILENAME saves all workspace variables to the binary "MAT-file"
named FILENAME.mat. The data may be retrieved with LOAD. If FILENAME
has no extension, .mat is assumed.
SAVE, by itself, creates the binary "MAT-file" named 'matlab.mat'. It is
an error if 'matlab.mat' is not writable.
SAVE FILENAME X saves only X.
SAVE FILENAME X Y Z saves X, Y, and Z. The wildcard '*' can be used to
save only those variables that match a pattern.
ASCII Options:
SAVE ... -ASCII uses 8-digit ASCII form instead of binary regardless
of file extension.
SAVE ... -ASCII -DOUBLE uses 16-digit ASCII form.
SAVE ... -ASCII -TABS delimits with tabs.
SAVE ... -ASCII -DOUBLE -TABS 16-digit, tab delimited.
MAT Options:
SAVE ... -MAT saves in MAT format regardless of extension.
SAVE ... -V4 saves a MAT-file that MATLAB 4 can LOAD.
SAVE ... -APPEND adds the variables to an existing file (MAT-file only).
When using the -V4 option, variables that incompatible with MATLAB 4 are
not saved to the MAT-file. For example, ND arrays, structs, cells, etc.
cannot be saved to a MATLAB 4 MAT-file. Also, variables with names that
are longer than 19 characters cannot be saved to a MATLAB 4 MAT-file.
Use the functional form of SAVE, such as SAVE('filename','var1','var2'),
when the filename or variable names are stored in strings.
See also LOAD, DIARY, FWRITE, FPRINTF, UISAVE, FILEFORMATS.
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试