General question to cell arrays and structures
2 次查看(过去 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!