peak finding of a graph

조회 수: 1 (최근 30일)
ARPITA MONDAL
ARPITA MONDAL 2020년 7월 27일
편집: ARPITA MONDAL 2020년 7월 27일
I am attaching the x and y data vector here. Whenever I am using findpeaks command for findind the peaks
x=V1_1_new
y=y1_1_new
findpeaks(y1_1_new,V1_1_new)
I am getting this error
Error using findpeaks
Expected X to be increasing valued.
Error in findpeaks>parse_inputs (line 215)
validateattributes(Xin,{'double'},{'real','finite','vector','increasing'},'findpeaks','X');
Error in findpeaks (line 134)
= parse_inputs(Yin,varargin{:});
How can I solve this error

채택된 답변

KSSV
KSSV 2020년 7월 27일
load("matlab_peak.mat") ;
x=V1_1_new ;
y=y1_1_new ;
[pks,idx] = findpeaks(y) ;
plot(x,y)
hold on
plot(x(idx),y(idx),'*r')
  댓글 수: 1
ARPITA MONDAL
ARPITA MONDAL 2020년 7월 27일
편집: ARPITA MONDAL 2020년 7월 27일
Thanks a lot. it has solved my problem.
Now, I am getting 7 peaks here. But If I wanted more peaks(11 peaks) ,Then what should I do?
x= V1_1_new is the voltage value in volt.
In x vs y plot if I want peak in every 30mv distance then what should I do

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

추가 답변 (1개)

Serhii Tetora
Serhii Tetora 2020년 7월 27일
x=V1_1_new;
y=y1_1_new;
[pks, locs] = findpeaks(y);
plot(x,y,x(locs),pks,'o')

카테고리

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