Clear Filters
Clear Filters

find peaks of excel graph

27 views (last 30 days)
saphir alexandre
saphir alexandre on 18 Apr 2024
Answered: Cris LaPierre on 18 Apr 2024
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 Comments
AH
AH on 18 Apr 2024
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
Voss on 18 Apr 2024
"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.

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre on 18 Apr 2024
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.

Community Treasure Hunt

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

Start Hunting!