how can i combine arrays of different size.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
zhoug zho
il 31 Mag 2021
Risposto: Walter Roberson
il 31 Mag 2021
i have six arrays of size as given in figure.
i need to combine all arrays one after the other.
but the problem is they are of different dimenion.
how can i combine all these arrays?
thanks in advance.
4 Commenti
Risposta accettata
Walter Roberson
il 31 Mag 2021
sizes = cell2mat(cellfun(@size, YourCell(:), 'uniform', 0));
maxcols = max(sizes(:,2));
combined = cell2mat(cellfun(@(M) [M, zeros(size(M,1), maxcols-size(M,2))], YourCell(:), 'uniform', 0));
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!