New array from several arrays

1 回表示 (過去 30 日間)
Ismaeel
Ismaeel 2015 年 3 月 21 日
回答済み: Ismaeel 2015 年 3 月 21 日
Hi,
I have the three arrays:
[a(1) a(2) a(3)]
[b(1) b(2) b(3)]
[c(1) c(2) c(3)]
and I want to make a new array as following:
[a(1) b(1) c(1) a(2) b(2) c(2) a(3) b(3) c(3)]
I greatly appreciate any help or any idea
Thanks
  1 件のコメント
Konstantinos Sofos
Konstantinos Sofos 2015 年 3 月 21 日
Are all of your matrices of the same dimensions?

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 3 月 21 日
編集済み: Azzi Abdelmalek 2015 年 3 月 21 日
out=[a;b;c];
out=out(:)'

その他の回答 (2 件)

Stephen23
Stephen23 2015 年 3 月 21 日
編集済み: Stephen23 2015 年 3 月 21 日
>> A = [1,2,3];
>> B = [4,5,6];
>> C = [7,8,9];
>> D = reshape([A;B;C],1,[])
D =
1 4 7 2 5 8 3 6 9

Ismaeel
Ismaeel 2015 年 3 月 21 日
Thank you so much. They were helpful, both of them.

カテゴリ

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