Maximum Or Minimum for N Dimension Array

These functions return the subscripts of the maximum or minimum in an Array
1.2K Downloads
Updated 18 Aug 2007

View License

%maxNsarvas N-D Array Maximum With Subscript Output
%
% X = MAXN(A) returns the maximum value found as the first element followed
% by the subscripts of A. No knowledge about the size of A is needed prior
% to use.
%
% X = [maximum(A) sub1 sub2 sub3 . . . subN];
%
% If the maximum appears more than once (M times), each row contains
% the maximum followed by a set of subscripts that correspond to it.
%
% X = [maximum(A) sub1_1 sub2_1 sub3_1 . . . subN_1]
% [maximum(A) sub1_2 sub2_2 sub3_2 . . . subN_2]
% :
% [maximum(A) sub1_M sub2_M sub3_M . . . subN_M]
%
% This code uses D.C. Hanselman's MAXN routine.
% August 2007
% Serhend Arvas, Syracuse University.

%
%minNsarvas N-D Array Minimum With Subscript Output
%
% X = MINN(A) returns the minimum value found as the first element followed
% by the subscripts of A. No knowledge about the size of A is needed prior
% to use.
%
% X = [minimum(A) sub1 sub2 sub3 . . . subN];
%
% If the minimum appears more than once (M times), each row contains
% the minimum followed by a set of subscripts that correspond to it.
%
% X = [minimum(A) sub1_1 sub2_1 sub3_1 . . . subN_1]
% [minimum(A) sub1_2 sub2_2 sub3_2 . . . subN_2]
% :
% [minimum(A) sub1_M sub2_M sub3_M . . . subN_M]
%
% This code uses D.C. Hanselman's MINN routine.
% August 2007
% Serhend Arvas, Syracuse University.
%
% See also maxNsarvas

Cite As

Serhend Arvas (2024). Maximum Or Minimum for N Dimension Array (https://www.mathworks.com/matlabcentral/fileexchange/15975-maximum-or-minimum-for-n-dimension-array), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Fourier Analysis and Filtering in Help Center and MATLAB Answers
Acknowledgements

Inspired: MIN2, MAX2

Communities

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0