Combine of two matrices

2 Ansichten (letzte 30 Tage)
Volkan Yangin
Volkan Yangin am 30 Mai 2017
Kommentiert: Volkan Yangin am 30 Mai 2017
Hi everbody I have two matrices like these:
A=[10 12 14 16 18]
B=[1 3 5 7 9]
I should combine two matrices as:
AB=[10 1 12 3 14 7 16 9 18];
What kind of a code must be written for this operation?
Thanks...

Akzeptierte Antwort

Adam
Adam am 30 Mai 2017
Bearbeitet: Adam am 30 Mai 2017
AB = reshape( [A; B], [1 10] )
will give you what I guess you want. What you claim you want doesn't have any obvious logic.
  1 Kommentar
Volkan Yangin
Volkan Yangin am 30 Mai 2017
It works perfectly. Thanks Adam.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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