Peak value on plot graph

조회 수: 20 (최근 30일)
Reff
Reff 2020년 1월 15일
댓글: Star Strider 2020년 1월 16일
y=a1(:,1);
chan1= y-mean(a1);
fs=128;
d=1/fs;
t=[0:length(chan1)-1]*d;
fs=fft(chan1,128);
pp=fs.*conj(fs)/128;
ff=(2:9)/128/d;
figure(4);
plot(ff,pp(2:9));
title('Power Spectrum');
xlabel('Frequency(Hz)');
ylabel('Power Spectrum Density(µv)');
grid on;
Peak.jpg
How to find peak value on y-axis without using Data Cursor tools. Thanks in advance.

채택된 답변

Star Strider
Star Strider 2020년 1월 15일
If you have R2017b or later, you can use the islocalmax function.
If you have the Signal Processing Toolbox, you can use the findpeaks function.
  댓글 수: 4
Reff
Reff 2020년 1월 16일
Hi Strider,
It works well. Really aprreciate it. Thanks.
Star Strider
Star Strider 2020년 1월 16일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by