Filter löschen
Filter löschen

Appending variables from different mat files

1 Ansicht (letzte 30 Tage)
wesso Dadoyan
wesso Dadoyan am 17 Apr. 2016
Beantwortet: Azzi Abdelmalek am 17 Apr. 2016
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 17 Apr. 2016
a=dir('*.mat')
b={a.name}
v=[];
for k=1:numel(b)
load(b{k})
v=[v;abc]
end

Weitere Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by