如何更新 matlab .mat 文件中的变量?
我有一个存储一堆变量的 matlab .mat 文件。如何更新单个变量?
我尝试这样做:
load('filename.mat');
variable='Test';
save('filename.mat',variable);
但它说
??? Error using ==> save
Variable 'C:\' not found.
这是什么意思以及我该如何解决它?
谢谢你!
I have a matlab .mat file that stores a bunch of variables. How do I update a single variable?
I tried doing this:
load('filename.mat');
variable='Test';
save('filename.mat',variable);
but it says
??? Error using ==> save
Variable 'C:\' not found.
What does this mean and how can I fix it?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找“-append”选项:
来自 http://www .mathworks.com/help/techdoc/ref/save.html
I think you are looking for the "-append" option:
From http://www.mathworks.com/help/techdoc/ref/save.html
要将单个变量保存到 .mat 文件,您需要引用其名称:
请参阅 http://www.mathworks.co.uk/help/techdoc/ref/save.html。
To save an individual variable to a .mat file, you need to quote its name:
See http://www.mathworks.co.uk/help/techdoc/ref/save.html.