View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Running Extrema

5.0 | 3 ratings Rate this file 7 Downloads (last 30 days) File Size: 2.72 KB File ID: #18551 Version: 1.0
image thumbnail

Running Extrema


Dan K (view profile)


31 Jan 2008 (Updated )

Returns the running minimum or maximum of a vector or matrix (analagous to the running average)

| Watch this File

File Information

Given a set of data, this function is intended to return an output of the same size which gives the lowest (or highest) values which are present within the specified window size. Algorithm is *much* faster than sequential calls to min with reduced ranges, at least for large data sets.

% runningmin - Computes a running extreme of an input vector or matrix
% Optional file header info (to give more details about the function than in the H1 line)
% Syntax: out = runningmin(input,nSamples,type)
% input - vector or matrix of data to return the running min or max from
% nSamples - The size of the window to check for mins or maxes
% type - 'min','max', or 'both' (default) which type of extremes to return
% out - running minimum or maximum requested. If both minimum is returned
% first, then maximum
% Example
% [runMin,runMax] = runningExtreme(data,31,'both')
% Subfunctions: fillIn
% See also: min, max, sort

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
08 May 2016 Frank

Frank (view profile)

02 May 2013 Bas-Jan

08 May 2012 Peter O'Connor

where have you been all my life?

Contact us