max_min

Version 1.0.0.0 (1.78 KB) by M MA
Get extremes of series.
2.2K Downloads
Updated 11 Jan 2006

View License

Syntax:
[MAX,MIN] = MAX_MIN(X,DISP)

Inputs:
X Vector to analyse
DISP Show result in a plot (new figure) [ {0} | 1 ]

Output:
MAX Maximums structure with fields .i .val .iabs .abs (indices, values, indice of absolute maximum, absolute maximum)
MIN Minimums structure with fields .i .val .iabs .abs (indices, values, indice of absolute minimum, absolute minimum)

Example: (see screenshot)
x=[2 2 1 1 1 2 3 1 .5 1 1 1 .5 .5 .5 .7 .1 1 1 1 ];
[Max, Min]=max_min(x,1);
legend('x','max','min','abs max','abs min')

Cite As

M MA (2026). max_min (https://uk.mathworks.com/matlabcentral/fileexchange/9572-max_min), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Data Distribution Plots in Help Center and MATLAB Answers
Version Published Release Notes
1.0.0.0