The fastest way to find local minimum
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hg
el 20 de Oct. de 2015
Comentada: Hg
el 20 de Oct. de 2015
What is the most efficient/fastest way to find the circled local minimum below, the lowest minima between two highest peaks? The graph was created by plot(x,y).
5 comentarios
Walter Roberson
el 20 de Oct. de 2015
Never name a variable "min"; that interferes with using the MATLAB min() function. For example,
[peaks, locs] = findpeaks(x, y,'MinPeakProminence',100);
[minval, minidx] = min( x(locs(1):locs(2)) );
%minidx is relative to the subset of values, so move it back to full range
minidx = minidx + locs(1) - 1;
Respuesta aceptada
Image Analyst
el 20 de Oct. de 2015
Invert your signal
invertedSignal = max(signal(:)) - signal;
Now valleys will be peaks. Then call find peaks.
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!