Borrar filtros
Borrar filtros

Multidimensional Arrays of different size

145 visualizaciones (últimos 30 días)
arnaud ensberg
arnaud ensberg el 9 de Abr. de 2015
Comentada: arnaud ensberg el 12 de Abr. de 2015
Hello
can i creat a Multidimensional Arrays of matrix of different size, like this :
mulat(:,:,1)=[1 3;3 5;5 6]
mulat(:,:,2)=[1 3;3 5;5 6;2 3]
??? Subscripted assignment dimension mismatch.% code

Respuesta aceptada

Michael
Michael el 9 de Abr. de 2015
Not like that. The best solution will depend on your goal. One option is to store the arrays in a cell array.
mulat={[1 3;3 5;5 6]}
mulat{2}=[1 3;3 5;5 6;2 3]
  1 comentario
arnaud ensberg
arnaud ensberg el 12 de Abr. de 2015
please what is the difference between mulat{2} and mulat (2) ?

Iniciar sesión para comentar.

Más respuestas (1)

Jan
Jan el 12 de Abr. de 2015
Editada: Jan el 12 de Abr. de 2015
Numerical arrays contain numerical scalars as elements. Therefore it is impossible to store a different number of elements in different slices of the same dimensions. This is simply the definition of a numerical array.
Using the curly braces { and } you create a cell array . These arrays can contain variables of any type and dimensions as elements. Please read the documentation: doc cell

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by