Reduce size of multidimensional array
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Early Social Development Lab Lab
le 8 Fév 2021
Commenté : James Tursa
le 9 Fév 2021
Hello,
I have a multidimensional array size = 220 x 46 x 10 x 4 x2 . I would like to combine all of the data in the third dimension so that way I end up with a 4-dimesional array. Any help is greatly appreciated.
Take care and stay well!
0 commentaires
Réponse acceptée
James Tursa
le 8 Fév 2021
One way using summing:
result = squeeze(sum(your_array,3));
7 commentaires
James Tursa
le 9 Fév 2021
Yes. Reshape does not change the order of the data in memory. You will often need to use another function first such as permute or transpose etc. to rearrange the data in memory before applying the reshape.
Plus de réponses (0)
Voir également
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!