Borrar filtros
Borrar filtros

How to create a 4 dimensional array??

179 visualizaciones (últimos 30 días)
Michael
Michael el 1 de Dic. de 2011
Comentada: Precious Chukwuezi el 30 de Dic. de 2023
This is just a general question because I can't find it anywhere, but does anyone know how to create a 4-D array? What would the basic code be for it or just a basic example of one would be great!

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Dic. de 2011
Supposing A and B are 3 dimensional arrays, then cat(4,A,B) would join them along the fourth dimension.
  1 comentario
Jan
Jan el 1 de Dic. de 2011
This works for 2D arrays also, because they are just special 3D arrays. See: "cat(4, 1, 1)".

Iniciar sesión para comentar.

Más respuestas (1)

the cyclist
the cyclist el 1 de Dic. de 2011
Editada: John Kelly el 26 de Feb. de 2015
Here is a trivial example:
>> A = zeros(2,3,5,7);
>> A(1,2,1,2) = 6;
>> A(1,1,5,6) = 5;
>> A(2,1,1,:) = pi;
  3 comentarios
erfan vahdat
erfan vahdat el 28 de Jul. de 2020
thanks
Precious Chukwuezi
Precious Chukwuezi el 30 de Dic. de 2023
thanks

Iniciar sesión para comentar.

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