フィルターのクリア

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?
  1 件のコメント
RDG
RDG 2013 年 10 月 8 日
Found it.
C=vertcat(A{:})

サインインしてコメントする。

採用された回答

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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by