Filter löschen
Filter löschen

General question to cell arrays and structures

4 Ansichten (letzte 30 Tage)
Ahmed Hossam
Ahmed Hossam am 23 Apr. 2017
Bearbeitet: Ahmed Hossam am 23 Apr. 2017
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!

Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by