How to trace only peaks from excel data

2 ビュー (過去 30 日間)
newport portnew
newport portnew 2018 年 7 月 4 日
回答済み: newport portnew 2018 年 7 月 5 日
Good morning, I need your help, please. I have an excel file containing in the first two columns position data X and Y . In the third of the data which represents time and finally in the fourth column of the data which represents frequencies. my objective is to plot the most important peaks of the frequency graph according to the X and Y axes. here is an example. I first plotted the frequencies as a function of time but I can't plot only the largest peaks.
Here my code :
clear all
close all
hold on
clc
[data,Vt,T] = xlsread('DataBin.xlsx','Feuil2','A4:D16359');
Xdata=data(:,1);
Ydata=data(:,2);
timedata=data(:,3);
freqdata=data(:,4);
X = Xdata;
Y = Ydata;
time = timedata;
freq = freqdata;
X = data(4:size(Xdata,1),1);
Y = data(4:size(Ydata,1),2);
time = data(4:size(timedata,1),3);
freq = data(4:size(freqdata,1),4);
Thanks in advance.

回答 (2 件)

newport portnew
newport portnew 2018 年 7 月 5 日
I don't understand Why when I run this code , it's doesn't work.
Error in findpeaks>parse_inputs (line 199) validateattributes(Yin,{'double','single'},{'nonempty','real','vector'},...
Error in findpeaks (line 136) = parse_inputs(isInMATLAB,Yin,varargin{:});
Error in Pic_function (line 24) [ peak_value , peak_location ] = findpeaks (signal,'minpeakheight',0.1);
clear all close all hold on clc
[data,Vt,T] = xlsread('DataBin.xlsx','Feuil2','A4:D16359');
Xdata=data(:,1); Ydata=data(:,2); timedata=data(:,3); freqdata=data(:,4);
X = Xdata; Y = Ydata; time = timedata; freq = freqdata;
X = data(4:size(Xdata,1),1); Y = data(4:size(Ydata,1),2); time = data(4:size(timedata,1),3); freq = data(4:size(freqdata,1),4);
signal = plot(time,freq); [ peak_value , peak_location ] = findpeaks (signal,'minpeakheight',0.1);

KSSV
KSSV 2018 年 7 月 4 日
Read about max, min and findpeaks.
  1 件のコメント
newport portnew
newport portnew 2018 年 7 月 4 日
Yes I read findpeak but it only allows to identify peaks but not to trace only peaks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by