如何将变量追加到.mat文件中?

3

如果我已经有一个包含变量 xy.mat 文件,是否有一种方法可以使用 save 命令将另一个变量 z 添加到 .mat 文件中,而不必在保存命令中明确指定变量 xy

2个回答

6
如果您查看save()函数文档,就会发现其中有一种形式的保存命令可能会有所帮助。
save(filename, ..., '-append')

这个表单的帮助内容如下:

save(filename, ..., '-append') 可以将新变量添加到现有文件中。您可以使用 '-append' 选项指定额外的输入,例如变量、'-struct'、格式或版本。


0
手册页面中:

save(filename)
save(filename, variables)
save(filename, '-struct', structName, fieldNames)
save(filename, ..., '-append')
save(filename, ..., format)
save(filename, ..., version)
save filename ...

...

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.


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接