Reshape nested cell arrays into the a different nested cell array organization
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alyssa
le 2 Août 2024
Réponse apportée : Walter Roberson
le 2 Août 2024
Hello, I have a nested cell array that has been built up such that the first level cell array A is {691x1}; within each cell in A, there is a second level cell array B of {48x1}; lastly within each cell in B there is a third level nested cell array C of {2x1}.
I want to reshape the nested cell array structure such that it is now organized in the order of cell array B {48x1} first; second level cell array C {2x1} and lastly a third level cell array of A {691x1}.
Is there a way to take the original cell array and use a specific function (such as reshape) to get my desired new nested cell array from my current nested cell array?
have: A {691x1} --> B{48x1} --> C{2x1}
want: B{48x1} --> C{2x1} --> A {691x1}
Thanks!
0 commentaires
Réponse acceptée
Walter Roberson
le 2 Août 2024
No, there is no way to do it.
Consider that you have your B 48 x 1 for each A 691 x 1. So there are 48*691 = 33168 different B. But you want to reorder it so there are only 48 different B. You would have to discard 33120 of the contents of B.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping 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!