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
DICOMDIR Reader Icon
It can let you select a dicom series from a DICOMDIR directory.
Free
Dijkstra Shortest Path Routing Icon
This function and example show shortest path routing based on Dijkstra algorithm
Free
MATLAB Petri Net Toolbox Icon
For analysis of hybrid system modeling.
Free
Hopfield Neural Network Icon
A Hopfield neural network to identify patterns in a binary image
Free
RADAR simulation Icon
This is an early warning radar simulation.
Free
Adobe Photoshop PSD file reader Icon
Functions to read images and get metadata from Adobe Photoshop PSD files.
Free
Path Loss Icon
Path Loss - Matlab code and Plot for plane earth model and free space model used
EM_GM Icon
An expectation maximization algorithm
Free
More