Append variables in mat file
6 次查看(过去 30 天)
显示 更早的评论
Making a simple example, where I load a .mat file to append to a variable. How do I then save the .mat file again after the appending?
current = [1 2 3];
new_current = [4 7];
volt = [7 5 4];
save('data.mat','current','volt');
data = load('data.mat');
data.current = [data.current new_current];
save .matfile?!?!!
0 个评论
回答(3 个)
Toke
2014-7-29
Hi.
Thanks for the answer but that is not what I want. I want to replace data.current with the new data.current I have made from:
data.current = [data.current new_current];
0 个评论
erdinc
2022-11-17
current = [1 2 3];
new_current = [4 7];
volt = [7 5 4];
save('data.mat','current','volt');
load('data.mat','current');
current = [current new_current];
save(file,'current','-append')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!