필터 지우기
필터 지우기

General question to cell arrays and structures

조회 수: 4 (최근 30일)
Ahmed Hossam
Ahmed Hossam 2017년 4월 23일
편집: Ahmed Hossam 2017년 4월 23일
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개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by