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!