フィルターのクリア

Looking for source of minimum value in 3d array

2 ビュー (過去 30 日間)
Fidya
Fidya 2023 年 3 月 31 日
回答済み: Meet 2023 年 4 月 3 日
Hello, everyone
I would like to ask for a code to look for which array I get my minimum values from
I have this code
Dt=cat(3,Dt1,Dt2,Dt3,Dt4,Dt5); DtA=min(Dt,[],3)
I would like to get which Dt(n) i get the DtA(x,y) from
Thank you in advance
  1 件のコメント
Torsten
Torsten 2023 年 3 月 31 日
From the documentation:
[M,I] = min(___) also returns the index into the operating dimension that corresponds to the first occurrence of the minimum value of A.

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

採用された回答

Meet
Meet 2023 年 4 月 3 日
Assuming that the arrays Dt1,Dt2,Dt3,Dt4,Dt5 are of 1 or 2 dimensions, then you can easily find which Dt(n) has the minimum value simply by using the function as [DtA, I] = min(Dt,[],3]. Here, the matrix I will contain the indices into the operating dimension (in your case i.e. 3) in which the first occurence of the minimum value of Dt was found.
But if the arrays Dt1,Dt2,Dt3,Dt4,Dt5 are of 3 or more dimensions then you will need to find some different way to get the required indices as the function min will not provide it directly.
Please refer the documentation of min for more details.

その他の回答 (0 件)

カテゴリ

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