Reshape nested cell arrays into the a different nested cell array organization

3 次查看(过去 30 天)
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!

采纳的回答

Walter Roberson
Walter Roberson 2024-8-2
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 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by