Maximum Or Minimum for N Dimension Array
%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 (2026). Maximum Or Minimum for N Dimension Array (https://uk.mathworks.com/matlabcentral/fileexchange/15975-maximum-or-minimum-for-n-dimension-array), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: MIN2, MAX2
Communities
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
