assume that a={[1 2 3],[2 3 4;1 2 3]} I want to convert a into a=[1 2 3;2 3 4;1 2 3]. Is there any easy way? thanks

 採用された回答

Stephen23
Stephen23 2016 年 2 月 12 日

0 投票

>> a={[1 2 3],[2 3 4;1 2 3]}
a =
[1x3 double] [2x3 double]
>> vertcat(a{:})
ans =
1 2 3
2 3 4
1 2 3

その他の回答 (1 件)

Kiran
Kiran 2016 年 2 月 12 日

0 投票

Hi Song,
You can use 'cat' command to concatenate array according to your need.
m = cat(1,a{1},a{2})
Above command will concatenate the array 'a' along vertical direction as you need.

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

タグ

質問済み:

2016 年 2 月 9 日

回答済み:

2016 年 2 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by