Problem with findpeaks - error message of 'undefined variable "coder"'

조회 수: 1 (최근 30일)
Seth
Seth 2014년 8월 28일
댓글: Image Analyst 2014년 8월 29일
I am trying to use the findpeaks function out of the signal processing toolbox. When I enter something like...
data = [1 15 4 2]
[pks,local] = findpeaks(data)
...I get
Undefined variable "coder" or class "coder.target".
Error in findpeaks>parse_inputs (line 99)
if coder.target('MATLAB')
Error in findpeaks (line 71)
[X,Ph,Pd,Th,Np,Str,infIdx] = parse_inputs(Xin,varargin{:});
99 if coder.target('MATLAB')
I am running Matlab 2014a with signal & stats & mapping toolboxes & have confirmed that I am pointing to the correct findpeaks function via "which -all findpeaks"

채택된 답변

AJ von Alt
AJ von Alt 2014년 8월 29일
This looks like it might be a path issue. Try:
restore defaultpath
savepath
rehash toolboxcache
and restart MATLAB.
  댓글 수: 2
Seth
Seth 2014년 8월 29일
That worked; thanks, AJ!!!
Image Analyst
Image Analyst 2014년 8월 29일
I'm really baffled as to why that worked since you said you "have confirmed that I am pointing to the correct findpeaks function via "which -all findpeaks"" Did you ever find out why that worked? Did you have your own function you wrote called coder()????

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Star Strider
Star Strider 2014년 8월 28일
I’m a bit concerned about ‘...something like...’.
What returns when you run:
ac = class(data)
where ‘data’ is your argument to findpeaks.
If that comes back as double, I’m out of ideas and I’ll delete this.
  댓글 수: 2
Seth
Seth 2014년 8월 28일
ac = class(data) (where data = [1 10 2 6 5 11])
does come back as double. Thanks anyway!
Star Strider
Star Strider 2014년 8월 28일
It may be time to put in a Support Request to TMW.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2014년 8월 29일
For me it runs fine and gives:
data =
1 15 4 2
pks =
15
local =
2
Try putting a "clear all" before your code and try again. I don't have the mapping toolbox, or the MATLAB Coder toolbox either. What toolboxes are listed when you do "ver"?
  댓글 수: 1
Seth
Seth 2014년 8월 29일
Same thing happens after "clear all", and the toolboxes that come up via "ver" are Mapping, Signal Processing, & Statistics, all R2014a.
I'm going to put in a support request to Mathworks; seems like it might be something specific to my install, since nobody else is experiencing this.
Thanks for the suggestions!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by