How to create a 4 dimensional array??

179 次查看(过去 30 天)
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!

采纳的回答

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

请先登录,再进行评论。

更多回答(1 个)

the cyclist
the cyclist 2011-12-1
编辑:John Kelly 2015-2-26
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;

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by