double in a "gain" function

clf; M = 2; num = ones(1,M)/M; [g,w] = gain(num,1); plot(w/pi,g);grid
can you fix this please. The double value of num will not process through the gain function and I don't know what to do. It says: Undefined function 'gain' for input arguments of type 'double'.

回答 (1 件)

Adam
Adam 2014 年 11 月 11 日
編集済み: Adam 2014 年 11 月 11 日

0 投票

What is gain?
Type:
which gain
on the command line. If it doesn't point to a function file then you presumably need to add whatever it is to your path. The error message for that is always a little misleading and has nothing to do with 'double', that is just the default type for matlab arguments so it always says unknown for double if the function just doesn't exist on the path at all.

7 件のコメント

Kyler
Kyler 2014 年 11 月 11 日
It does exist
Kyler
Kyler 2014 年 11 月 11 日
I looked that up and tried that
Kyler
Kyler 2014 年 11 月 11 日
C:\Program Files\MATLAB\R2013a\toolbox\dsp\filterdesign\@mfilt\gain.m % mfilt method that comes back
Adam
Adam 2014 年 11 月 11 日
In that case the error message is a mystery as that is the only reason I am aware of for that message.
Kyler
Kyler 2014 年 11 月 11 日
Well wtf haha
Kyler
Kyler 2014 年 11 月 11 日
When I open the gain.m function there is no function in there only a bunch of comments. What up with that
Kyler
Kyler 2014 年 11 月 11 日
Its in the DSP toolbox

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

カテゴリ

ヘルプ センター および File ExchangeSimulation についてさらに検索

質問済み:

2014 年 11 月 11 日

コメント済み:

2014 年 11 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by