max and min values in an array

3 ビュー (過去 30 日間)
Anh Dao
Anh Dao 2019 年 4 月 7 日
コメント済み: madhan ravi 2019 年 4 月 7 日
thank you! Found the solution! Thank you!
  3 件のコメント
madhan ravi
madhan ravi 2019 年 4 月 7 日
So as I understand you want to find the max value for each 16 rows ???
madhan ravi
madhan ravi 2019 年 4 月 7 日
NO NO NO!!!!,Why did you delete all the contents of the question and the comments?, it's a terrible thing to do . Others may also benefit from the question.

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

採用された回答

madhan ravi
madhan ravi 2019 年 4 月 7 日
編集済み: madhan ravi 2019 年 4 月 7 日
See if this does what you want , first we split into 16 separate rows each and then we conquer in the third dimension:
[m,n]=size(A); % where A is your matrix of size 256 X 40K
parts = 16;
AA = permute(reshape(A.',n,m/parts,[]),[2,1,3]);
Max = max(AA,[],[1,2]); % max(max(AA)) for versions <= 2016b
[r,~]=find(AA == Max) % r represents rows
  6 件のコメント
Anh Dao
Anh Dao 2019 年 4 月 7 日
Thank you, so I have a matrix A equal 256x40000
it was a mistake that I put in last time that i put parts = 15, sorry about that, so r should be correct right, what's the difference in the code you posted?
[m,n]=size(A)
parts = 16;
AA = permute(reshape(DoM.',n,m/parts,[]),[2,1,3]);
Max = max(AA,[],[1,2]);
[r,~]=find(AA == Max)
madhan ravi
madhan ravi 2019 年 4 月 7 日
replace
[r,~]=find(AA == Max)
with
[r,c,p]=ind2sub(size(AA),find(AA==Max)) % r represents rows , c represents columns & p represents pages

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

その他の回答 (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