Marking the peak of a plot automatically without having to click on it
이전 댓글 표시
Hi,
Is it possible to mark the peak of a plot automatically with a command without having to to mark on each plot.
채택된 답변
추가 답변 (3개)
Wayne King
2012년 8월 29일
Do you know the value of the peak?, then yes, it's easy.
x = randn(100,1);
[val,I] = max(x);
plot(x); hold on;
plot(I,val,'r^','markerfacecolor',[1 0 0])
댓글 수: 7
Lisa Justin
2012년 8월 29일
편집: Lisa Justin
2012년 8월 29일
Tom
2012년 8월 29일
are you looking for one single maximum value, or are you looking for local peaks (i.e. the peaks of a sine wave where there can be several per plot)?
Lisa Justin
2012년 8월 29일
Tom
2012년 8월 29일
Then Wayne's code above should work fine.
Lisa Justin
2012년 8월 29일
Tom
2012년 8월 29일
It should be; can you provide some sample data?
Ilham Hardy
2012년 8월 29일
Below link is the 'how-to' display tooltip syntactically..
Happy reading,
Ilham Hardy
2012년 8월 29일
0 개 추천
댓글 수: 4
Lisa Justin
2012년 8월 29일
편집: Lisa Justin
2012년 8월 29일
Jan
2012년 8월 29일
Then use the output of the peakfinder and a simple TEXT command.
Lisa Justin
2012년 8월 29일
Jan
2012년 8월 29일
See "help text" and "doc text".
Sergio Yanez-Pagans
2021년 3월 28일
0 개 추천
You could use my MATLAB File Exchange function:
Hope you find this useful!
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!