Borrar filtros
Borrar filtros

How to create arrays for 3D matrix?

13 visualizaciones (últimos 30 días)
hamed
hamed el 18 de Ag. de 2016
Comentada: dbmn el 18 de Ag. de 2016
Hello
I created an array in order to put the results into it. Meanwhile, my matrix is 3D.
The 3D matrix is:
[4,3,2]=size(S)
And the created array is:
Result=[];
Is that a true definition?
Cheers
  1 comentario
dbmn
dbmn el 18 de Ag. de 2016
In general preallocation of matrices is not necessary in Matlab (it does increase speed, but is not necessary).
Just fill your matrix with the data and you should be fine. If you want to preallocate, use the solution that Siva showed. Zeros instead of rand might be an even better way.

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 18 de Ag. de 2016
k = rand(4,3,2) ; % create random 3d data
[m,n,p] = size(k) ; % get size

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays 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