I was curious what it means when we have that 3 arrays and,
Array = zeros(N,P,M);
Arr_tmp = zeros(N,P,M);
Array_2 = zeros(N,P,M);
.......
......
Array = Arr_tmp(Array_2)
The "....." mean intermediate calculations, which are not of importance. What I am confused by is what it means when you have a 3 parameter array but you evaluate it as a one parameter array. Is there a more enumerative equivalent?

1 件のコメント

Stephen23
Stephen23 2021 年 5 月 18 日
Array = zeros(N,P,M); % does nothing in this example.
Arr_tmp = zeros(N,P,M);
Array_2 = zeros(N,P,M);
.......
......
Array = Arr_tmp(Array_2)
'The "....." mean intermediate calculations, which are not of importance.'
Those calculations are important, otherwise attempting to use zeros as linear indices would throw an error.

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

回答 (1 件)

DGM
DGM 2021 年 5 月 18 日
編集済み: DGM 2021 年 5 月 18 日

0 投票

That would be the use of linear indices:
The linear indices of an array begin at A(1,1,1,...,1) and progress linearly columwise from there, to a maximum index equal to the number of elements in A.

カテゴリ

ヘルプ センター および File ExchangeMultidimensional Arrays についてさらに検索

製品

質問済み:

2021 年 5 月 18 日

コメント済み:

2021 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by