필터 지우기
필터 지우기

how to combine different matrix dimensions into a single matrix ?

조회 수: 21 (최근 30일)
rajesh kumar
rajesh kumar 2018년 5월 16일
댓글: Rik 2018년 5월 27일
for example i having m1=10*2, m2=10*3, m3=10*6; i want m=[m1,m2,m3] but due to different dimension it is not getting so any possibility to combine.

답변 (1개)

Rik
Rik 2018년 5월 16일
Matlab arrays must be rectangular. The concatenation you show is possible, so it should only give errors if you dimension description is wrong, or if the data types are not the same.
m1=rand(10,2);
m2=rand(10,3);
m3=rand(10,6);
%concatenating to cell always works:
m_cell={m1,m2,m3};
%concatenation to a normal array should work with your example:
m=[m1,m2,m3];
  댓글 수: 1
Rik
Rik 2018년 5월 27일
Did this suggestion solve your problem? If so, please consider marking it as accepted answer. It will make it easier for other people with the same question to find an answer. If this didn't solve your question, please comment with what problems you are still having.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by