rearrange a matrix into a vector by blocks
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can I rearrage the folloing matrix
into a vector [1 2 3 4 5 ... 36] without using for loops?
0 commentaires
Réponse acceptée
Stephen23
le 20 Fév 2021
M = [1,3,13,15,25,27;2,4,14,16,26,28;5,7,17,19,29,31;6,8,18,20,30,32;9,11,21,23,33,35;10,12,22,24,34,36]
V = reshape(permute(reshape(M,2,3,2,[]),[1,3,2,4]),1,[])
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!