Appending variables from different mat files
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have many mat files that contain the same variables. Is there any function that would help me to append these variables in 1 file. for example x.mat and y.mat contain abc vector . is there a way to append abc of file x to abc of file y ? I tried changing the names
load x
xyz=abc;
load y
xyz2=abc;
clear abc
abc=[xyz;xyz2];
but i have too many variables and i prefer to do it neatly if there is an append function in matlab
0 个评论
采纳的回答
Azzi Abdelmalek
2016-4-17
a=dir('*.mat')
b={a.name}
v=[];
for k=1:numel(b)
load(b{k})
v=[v;abc]
end
0 个评论
更多回答(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!