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