Peak to Peak Distance Help
古いコメントを表示
So I have a large data set of monthly averages which came in as a vector of 5000 or so points. I converted into 12x235 a matrix and then averaged each column to give me a vector of yearly averages for the data. The data resembles a sin curve and I need to find the distance between each peak. When I tried to use the peak to peak function, [pks,locs]=findpeaks(data,'minpeakdistance',3), it told me it could not compute it for type double. I tried converting to int and no luck. Please help.
3 件のコメント
Image Analyst
2013 年 1 月 22 日
編集済み: Image Analyst
2013 年 1 月 22 日
What does:
>> which -all findpeaks
say in the command window? What happens if you say "doc findpeaks"?
Image Analyst
2013 年 1 月 23 日
Are you sure it says it "could not compute it for type double", or does it really say "
Error using findpeaks (line 43)
Input arguments must be 'double'.
"? Because that's the complete opposite of what you said.
Jake Larson
2013 年 1 月 23 日
回答 (2 件)
The findpeaks needs data to be a double variable, not ints.
data=double(data)
[pks,locs]=findpeaks(data,'minpeakdistance',3)
1 件のコメント
Jake Larson
2013 年 1 月 23 日
Greg Dionne
2014 年 2 月 6 日
0 投票
It looks like you don't have the Signal Processing Toolbox.
You get that error when you try accessing a function that doesn't exist.
Try:
>> [pks,locs]=completelyundefinedfunction(x,'minpeakdistance',3) Undefined function 'completelyundefinedfunction' for input arguments of type 'double'.
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!