Scatter Plot of Local Minimums
1 view (last 30 days)
I'm trying to create a scatter plot using the local minima of the graph. However, it also marks a bunch of other points that are not minima. Please kindly let me know what is wrong with my code.
threshold = -0.0001;
[pks,locs] = findpeaks(-neural.spikes,'MinPeakHeight',abs(threshold));
plot(neural.Time,neural.spikes); hold on
line([min(neural.Time) max(neural.Time)],[threshold threshold],'color','r','LineWidth',1)