Borrar filtros
Borrar filtros

General question to cell arrays and structures

4 visualizaciones (últimos 30 días)
Ahmed Hossam
Ahmed Hossam el 23 de Abr. de 2017
Editada: Ahmed Hossam el 23 de Abr. de 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!

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by