local maxima minima Icon

local maxima minima

A simple (but effective) code to find local maximas

local maxima minimaOverview

This is a very simple function to find the local maximum in any dimensional array. As simple as it is it still gives nice results.

I use the imdilate() function as a maximum operation and then compare the data to the result.

The function receives three parameters:
the data, a vector defining the minimum distance Between peaks in each of the data dimensions. and a flag either to exclude equal points or not.

use examples:
a = cumsum(randn(1000,1));
peaks = localMaximum(a,[100]);
figure; plot(a); hold on; plot(peaks,a(peaks),'ro');

[x y] = meshgrid(-6:0.1:6,-6:0.1:6);
a = sinc(x).*sinc(y);
lMaxInd = localmaximum(a,[20 20]);
lMinInd = localMaximum(-a,[20 20]);
figure; mesh(x,y,a); hold on;
plot3(x(lMaxInd),y(lMaxInd),a(lMaxInd),'k*','markersize',10,'linewidth',1.5);
plot3(x(lMinInd),y(lMinInd),a(lMinInd),'g*','markersize',10','linewidth',1.5);
legend('sinc(x)sinc(y)','peaks','valleys','location','best')

NEW

Fixed some bugs.

local maxima minimaInformation

Version
N/A
Date
05.06.10
License
Free
Language
English
File Size
N/A
Category
SubCategory
Operating Systems
Windows ,Linux,Mac OS,BSD,Solaris
System Requirements
No additional system requirements.
Hopfield Neural Network Icon
A Hopfield neural network to identify patterns in a binary image
Free
area measuring Icon
Measuring areas surface and path length in an image (map)
Paid
Another TSP Solver Icon
A simple TSP local minimum solution. code is very short and simple.
Image Gallery Icon
This application allows you to select several image files.
Eye Aliasing Testing Icon
This script rotates a bunch of dots on the screen.
RADAR simulation Icon
This is an early warning radar simulation.
Free
More
Path Loss Icon
Path Loss - Matlab code and Plot for plane earth model and free space model used
RADAR simulation Icon
This is an early warning radar simulation.
Free
MATLAB Petri Net Toolbox Icon
For analysis of hybrid system modeling.
Free
DEA Solver light Icon
Educational solver to DEA.
Free
Hopfield Neural Network Icon
A Hopfield neural network to identify patterns in a binary image
Free
Color Image Histogram Icon
RGBHIST displays a histogram of the overall color balance of an image.
Free
MATLAB serial Icon
MATLAB supports serial devices including RS-232 when using the Instrument.
Free
DICOMDIR Reader Icon
It can let you select a dicom series from a DICOMDIR directory.
Free
More