find peaks of excel graph
조회 수: 11 (최근 30일)
이전 댓글 표시
Hello everyone,
I'm having some trouble with finding the peak coordinates of my excel data. The data has x and y values which i graphed, but i used findpeaks(data) and that did not work. I'm trying to have those peaks labeled as well if that is possible. Any help/suggestions are welcomes. Thank you
here is the graphs

here is what my code looks like
% graph
filename = 'HDPE-WAXS.xlsx';
which -all xlsread
DATA1 = readtable('HDPE-WAXS.xlsx');
%dintensity vs 2theta
intens = DATA1{:,2}; % intensity
twotheta = DATA1{:,4}; % 2theta
%plot of xrd hdpe
figure(1)
plot(twotheta,intens,'r')
xlabel('2theta (deg)')
ylabel('intensity (couts/sec)')
title('WAXS-XRD of HDPE')
댓글 수: 2
AH
2024년 4월 18일
You may want to try different options such as NPeaks, MinPeakHeight, ...
If you upload your data, we can provide you with a working syntax.
Voss
2024년 4월 18일
"i used findpeaks(data) and that did not work"
Do you mean findpeaks(intens)? If that didn't work, you may need to adjust the parameters you specify in the findpeaks call:
For more specific help/suggestions, please upload the xlsx file using the paperclip button.
답변 (1개)
Cris LaPierre
2024년 4월 18일
I recommend using the Find Local Extrema live task in a live script. It is an interactive way to determine the appropriate settings for the detecting peaks in your specific data set.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!