Reshaping/vectorizing a n-d matrix to a vector along each dimension
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
kowshik Thopalli
le 5 Avr 2018
Réponse apportée : James Tursa
le 5 Avr 2018
Lets say I have a matrix given by
a=randn(4,4,5);
How do I get a 80*1 vector along each dimension. That is the new vector vec B should look like the following
B=[a(1,1,1),a(1,1,2),..a(1,1,5),a(1,2,1),..,a(1,2,5),...a(4,4,5)]'
Both the below commands will not give this
B=a(:);
B=reshape(a,[80,1]);
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical 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!