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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by