how should I correctly use findpeaks() so that the output will not show me the following error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
chengwei zhang
am 22 Jan. 2020
Beantwortet: Jesus Sanchez
am 22 Jan. 2020
data=dlmread('Ge single crystal transmission.txt');
pks=findpeaks(data)
Error using findpeaks
Expected Y to be a vector.
Error in findpeaks>parse_inputs (line 191)
validateattributes(Yin,{'numeric'},{'nonempty','real','vector'},...
Error in findpeaks (line 134)
= parse_inputs(Yin,varargin{:});
please help me out. been stuck for days;(
PS: the version of matlab I used is R2016a
0 Kommentare
Akzeptierte Antwort
Jesus Sanchez
am 22 Jan. 2020
Data is a matrix of Nx2. You just need to select which vector you want to use to search for the peaks. I guess is the second one, while the first is X-values
data=dlmread('Ge single crystal transmission.txt');
pks=findpeaks(data(:,2))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!