max and min values in an array
조회 수: 1 (최근 30일)
이전 댓글 표시
thank you! Found the solution! Thank you!
댓글 수: 3
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
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
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 Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!