New array from several arrays

3 Ansichten (letzte 30 Tage)
Ismaeel
Ismaeel am 21 Mär. 2015
Beantwortet: Ismaeel am 21 Mär. 2015
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 Kommentar
Konstantinos Sofos
Konstantinos Sofos am 21 Mär. 2015
Are all of your matrices of the same dimensions?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 21 Mär. 2015
Bearbeitet: Azzi Abdelmalek am 21 Mär. 2015
out=[a;b;c];
out=out(:)'

Weitere Antworten (2)

Stephen23
Stephen23 am 21 Mär. 2015
Bearbeitet: Stephen23 am 21 Mär. 2015
>> 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 am 21 Mär. 2015
Thank you so much. They were helpful, both of them.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by