How can I merge multiple matrix in different size

조회 수: 3 (최근 30일)
Farshid Daryabor
Farshid Daryabor 2020년 3월 3일
답변: BobH 2020년 3월 3일
Dear,
I want to merge the attached example file to be a new matrix with a new size as new_matrix(8652*60). I really appreciate any help.
Thanks

채택된 답변

BobH
BobH 2020년 3월 3일
To merge the matrices and end with that size, they all must have the same number of rows.
You haven't suggested what value should be put into the padding rows, but if you can accept 0, simply assigning a value to subscript (8652,end) will auto-fill all intermediate rows with zero
T_2015(8652,end) = 0;
size(T_2015)
ans =
8652 12
and so on for the other three. From there you can horzcat all five matrices.
T_five = horzcat( T_2015, T_2016, T_2017, T_2018, T_2019 );

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by