You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
MDMAX Largest component in a multidimensional matrix.
For a matrix X, MDMAX(X) is the largest element in X.
[Y,I] = MDMAX(X) returns the indices of the maximum value in vector I.
When X is complex, the maximum is computed using the magnitude
MAX(ABS(X)). In the case of equal magnitude elements, then the phase
angle MAX(ANGLE(X)) is used.
NaN's are ignored when computing the maximum. When all elements in X
are NaN's, then the first one is returned as the maximum.
Example: If X = [2 8 4; then mDmax(X) is 9,
7 3 9]
and
[val,ind] = mDmax(X) returns val=9 and ind=[2 3]
Note: The vector ind can be used to access elements from X using this
neat trick:
sub = num2cell(ind)
val = x(sub{:});
Cite As
Naresh Vankayalapati (2026). Maximum value in multidimensional matrix (https://au.mathworks.com/matlabcentral/fileexchange/37392-maximum-value-in-multidimensional-matrix), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (1.57 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
