At first , Im new here so how can I plot the peak from my data

댓글 수: 2

Walter Roberson
Walter Roberson 2021년 2월 26일
That code already plots the peaks.
Phudit Kanittasut
Phudit Kanittasut 2021년 2월 26일
and how can I only dot the peak and hide the graph

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

 채택된 답변

Star Strider
Star Strider 2021년 2월 26일

0 개 추천

I am not certain what you want to do.
If you want to get the peaks and their indices, request those outputs:
[pks,locs] = findpeaks(pure_brain(:,2)); % Get Peaks (‘pks’) and Peak Indices (‘locs’)
I have no idea what is in your data file, however if you want to plot them and indicate them, try this:
x = 1:size(pure_brain,1);
figure
plot(x, pure_brain(:,2))
hold on
plot(x(locs), pure_brain(locs,2), '^r')
hold off
grid
.

댓글 수: 5

Phudit Kanittasut
Phudit Kanittasut 2021년 2월 26일
I want to have a dot at peak and hide graph how can I do it ?
Try this:
figure
plot(x(locs), pure_brain(locs,2), '.r')
grid
That will plot a red dot at the top of each peak findpeaks returns, and will not plot the line plot of the original data (that were plotted in the code I originally posted).
Phudit Kanittasut
Phudit Kanittasut 2021년 2월 26일
Its run nothing or waht should I write before this code
Phudit Kanittasut
Phudit Kanittasut 2021년 2월 26일
Oh I got it Thx u so much
Star Strider
Star Strider 2021년 2월 26일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기

태그

질문:

2021년 2월 26일

댓글:

2021년 2월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by