nikos
nikos

Reputation: 56

How to merge two .mat files that contain the same variables

I have two .mat files Argiris1.mat and Argiris2.mat that both contain the same variables ,how can i load them both on workspace and for example if one of the variables is Wkinet which is 100000*1000 matrix for every file and create an 200000*1000 matrix by combining the two

Upvotes: -2

Views: 1086

Answers (1)

Sven-Eric Krüger
Sven-Eric Krüger

Reputation: 1327

You can load the content of each MAT-Files into variable by simply using the return value. Afterwards you can process the two resulting structures and concatenate the matrices in the first dimension.

tmp1 = load('Argiris1');
tmp2 = load('Argiris2');

merged_wkinet = cat(1, tmp1.Wkinet, tmp2.Wkinet)

Upvotes: 3

Related Questions