フィルターのクリア

How to create a 4 dimensional array??

179 ビュー (過去 30 日間)
Michael
Michael 2011 年 12 月 1 日
コメント済み: Precious Chukwuezi 2023 年 12 月 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;
  3 件のコメント
erfan vahdat
erfan vahdat 2020 年 7 月 28 日
thanks
Precious Chukwuezi
Precious Chukwuezi 2023 年 12 月 30 日
thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by