Is it possible to change the size of a cell in a cell array?

4 visualizaciones (últimos 30 días)
rahul allam
rahul allam el 31 de Ag. de 2015
Comentada: Image Analyst el 31 de Ag. de 2015
If yes; then how do i do it?I created a cell array of dimensions (128,1) and the size of each cell is(4,1) as of now which i will have to change for getting an appropriate result. It would really feel to use some help.Thank you.
  1 comentario
Image Analyst
Image Analyst el 31 de Ag. de 2015
You can stuff whatever you want into a cell and it blows away what used to be in there. What's the data type? Are all cells going to be the same size? If so, and they're numbers, why not just use a regular 2D matrix? Or if they're different sizes, a structure array? Are there going to be strings in the cells?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 31 de Ag. de 2015
... Yes?
X = repmat({1, 2, 3, 4}, 128, 1);
X is now a cell array of length 128 that contains cells that are 1 x 4 numeric.
You can now say
X{42} = {1, 2, 3, 3.1, 3.14, 3.141, 3.1415};
and now X{42} will be a cell that contains 1 x 7 numeric.

Categorías

Más información sobre Logical 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