Problem with combining .mat files

1 view (last 30 days)
adele alias
adele alias on 20 Jun 2019
Commented: Adam Danz on 21 Jun 2019
Hi, I want to combine two .mat files that have the same matrice variables. The problem is when I combine them they are combined horizontally and I wish for them to be combined vertically.
Ex :
A (file1)=`
(222
111
333)
A(file2)=
(111
222
333)
Combined =
(222 111
111 222
333 333)
  3 Comments
Adam Danz
Adam Danz on 21 Jun 2019
To concatenate vertically,
datacell1 = load('file1.mat');
datacell2 = load('file2.mat');
combined2.uu = [datacell1.uu; datacell2.uu];
combined2.vv = [datacell1.vv; datacell2.v
% ^ semicolon

Sign in to comment.

Answers (1)

Himanshu Tripathi
Himanshu Tripathi on 21 Jun 2019
  1 Comment
adele alias
adele alias on 21 Jun 2019
Thankyou ! I used the function vertcat and it worked.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by