如何将变量附加到.mat文件? [英] How to append a variable to a .mat file?
本文介绍了如何将变量附加到.mat文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我已经有一个包含变量x
和y
的.mat
文件,有没有一种方法可以使用save
命令向.mat
文件中添加另一个变量z
,而不必在save命令中明确声明变量x
和y
?
If I already have a .mat
file with the variables x
and y
, is there a way to use the save
command to add another variable z
to the .mat
file without having to explicitly state the variables x
and y
in the save command?
推荐答案
If you look at the save()
function documentation, there is a form of the save command that might help:
save(filename, ..., '-append')
此表单的帮助如下:
save(filename, ..., '-append')
将新变量添加到现有文件.您可以将"-append"选项与变量,-struct",格式或版本等其他输入一起指定.
save(filename, ..., '-append')
adds new variables to an existing file. You can specify the '-append' option with additional inputs such as variables, '-struct' , format, or version.
这篇关于如何将变量附加到.mat文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文