General question to cell arrays and structures
조회 수: 4 (최근 30일)
이전 댓글 표시
I have defined some sort of a 'structure' made up of numbers and matrices of different sizes. I used cell arrays to build it up. All in one nice big cell array called S.
I've put each number I have in a cell inside the cell array S, whether standing alone or inside one of the matrices of different sizes!
I think it's better to have a cell for each number when thinking about finding every number with a similar indexing pattern, e.g.
S{x,y,z}{a,b}{:}.
is just the number of type double!
It took me long to come to this Idea and I spent a while figuring out, how to put a cell array of arbitrary size in a cell of a cell array.
I used something like
[S(x,y,z)(1:2,1:2)]={cell(1,1),cell(1,1),cell(1,1),cell(1,1)}
to define a 2 by 2 matrix inside of a cell of S, where each entry of this matrix is a cell.
Is there a better method for this preallocation and initialization?
Is this a good idea in general or is there some better ways to keep track of a lot of numbers flying around?
Is the use of cell arrays inside of cell arrays inside of cell arrays (!) a good idea?!
Thank you for your help!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!