Effacer les filtres
Effacer les filtres

how to combine 2 unequal matrices

1 vue (au cours des 30 derniers jours)
shanmukh
shanmukh le 8 Août 2013
I have 2 matrices A and B, i want to combine them to get C
A={
1
2
3}
B={
4
5}
C={
1 4
2 5
3
}

Réponses (1)

the cyclist
the cyclist le 8 Août 2013
Here is one possible way:
Am = length(A);
Bm = length(B);
Cm = max(Am,Bm);
C = cell(Cm,2);
C(1:Am,1) = A;
C(1:Bm,2) = B;

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by