how to find and mark the value of local minimums in a graph of multiple data ?
2 次查看(过去 30 天)
显示 更早的评论
I have a graph of multiple data taken experimentally. Now I want to find the troughs of the graph. I want to show the value of local minimas in the graph. How do I do it?
0 个评论
采纳的回答
Birdman
2018-2-15
Try this:
x=randi([1 7],1,10);
y=randi([3,10],1,10);
plot(x);hold on;plot(y);
[~,idxX]=findpeaks(-x);
[~,idxY]=findpeaks(-y);
plot(idxX,x(idxX),'o');plot(idxY,y(idxY),'o')
hold off;
2 个评论
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!