Concatenate More than 2 Variables

조회 수: 1 (최근 30일)
RDG
RDG 2013년 10월 8일
댓글: Walter Roberson 2013년 10월 8일
Can Matlab handle concatenation of more than 2 variables?
eg.
A{1}=[1 2 3]
A{2}=[4 5 6]
I understand that C=vertcat(A{1},A{2}).
However, if I have say 100 variables and I wish to vertcat them, how can I do so?
eg.
A{1}=[1 2 3]
A{2}=[4 5 6]
A{3}=[7 8 9]
A{4}=[10 11 12]
and so on....until A{30}.
How can I do so with a single function?

채택된 답변

Matt J
Matt J 2013년 10월 8일
Or,
C=cell2mat(A);
  댓글 수: 2
RDG
RDG 2013년 10월 8일
cell2mat only converts Cell to Double. It doesn't concatenate.
Walter Roberson
Walter Roberson 2013년 10월 8일
Actually it does concatenate.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by