hi i have a question for example I have these two matrices a and b and I want to join them in one, how could I do that?

17 vues (au cours des 30 derniers jours)
a=[1;3;5;7;9]; b=[2;4;6;8;10];
Resulting matrix
c=[1;2;3;4;5;6;7;8;9;10];

Réponse acceptée

Jos (10584)
Jos (10584) le 13 Juil 2017
a=[1;3;5;7;9]; b=[2;4;6;8;10];
c = [a b] % concatenate. only works because a and b have the same number of rows
c = c.' % transpose
c = c(:) % reshape

Plus de réponses (1)

Jose Sandoval
Jose Sandoval le 13 Juil 2017
thank you

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by