フィルターのクリア

Is the 'findpeaks' function available only in 2014b ?

2 ビュー (過去 30 日間)
Harish Narayanaswamy
Harish Narayanaswamy 2015 年 2 月 17 日
回答済み: geotocho 2017 年 8 月 10 日
I am getting this error "Undefined function 'findpeaks' for input arguments of type 'double' " while using 'findpeaks' in Matlab 2014a

採用された回答

Mischa Kim
Mischa Kim 2015 年 2 月 17 日
編集済み: Mischa Kim 2015 年 2 月 17 日
Harish, findpeaks is part of the Signal Processing Toolbox, which you might not have licensed/installed. To check if you do enter at the command prompt
>> which findpeaks
which should return something like
C:\Program Files\MATLAB\R2015a\toolbox\signal\signal\findpeaks.m
in case you have access to the toolbox.
  1 件のコメント
geotocho
geotocho 2017 年 8 月 10 日
Mischa I am having this same issue. My code runs on 2015b. When I moved to a different machine with 2014a I receive the same error as OP. I have the Signal Processing Toolbox. I validated this using the command which findpeaks.

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

その他の回答 (1 件)

geotocho
geotocho 2017 年 8 月 10 日
I beleive the issue you have, or may have resolved by now, is caused by the findpeaks input arguments. findpeaks has changed since MATLAB2014a. Currently findpeaks accepts a vector of indicies as the second argument for which [~,locs] is identified by. The 2014a version does not handle this index array as the second function argument. 2014a is looking for a string such as 'Tolerance' for the second input. 2014a findpeaks will output locs which may not precisely be the locs you want if you search only a portion of your signal for peaks.
To work around this and output the peak locs identified by 2014a I modified my code below:
% Find Peak Change in Covariance - Evaluated 99% Probability
% 2014b or later Version
[~,peakIx]=findpeaks(qCovAvg(100:end),Ix(100:end),'MinPeakHeight',q99);
% 2014a or Earlier Version
[~,peakIx] = findpeaks(qCovAvg(100:end),'MinPeakHeight',q99);
dumIx = Ix(100:end);
peakIx = dumIx(peakIx);
% Hope you find this helpful

カテゴリ

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