feval error with window function
6 views (last 30 days)
Show older comments
Error using feval Argument must contain a string or function_handle.
Error in window (line 54) w = feval(wname,N,varargin{:});
and this is a window function which is used in my project:
function varargout = window(wname,N,varargin)
%WINDOW Window function gateway.
% WINDOW(@WNAME,N) returns an N-point window of type specified
% by the function handle @WNAME in a column vector. @WNAME can
% be any valid window function name, for example:
%
% @bartlett - Bartlett window.
% @barthannwin - Modified Bartlett-Hanning window.
% @blackman - Blackman window.
% @blackmanharris - Minimum 4-term Blackman-Harris window.
% @bohmanwin - Bohman window.
% @chebwin - Chebyshev window.
% @flattopwin - Flat Top window.
% @gausswin - Gaussian window.
% @hamming - Hamming window.
% @hann - Hann window.
% @kaiser - Kaiser window.
% @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris window.
% @parzenwin - Parzen (de la Valle-Poussin) window.
% @rectwin - Rectangular window.
% @taylorwin - Taylor window.
% @tukeywin - Tukey window.
% @triang - Triangular window.
%
% WINDOW(@WNAME,N,OPT1,OPT2) designs the window with the optional input
% arguments specified in OPT1 and OPT2. To see what the optional input
% arguments are, see the help for the individual windows, for example,
% KAISER or CHEBWIN.
%
% WINDOW launches the Window Design & Analysis Tool (WinTool).
%
% EXAMPLE:
% N = 100;
% w = window(@blackmanharris,N);
% w1 = window(@gausswin,N,2.5);
% w2 = window(@taylorwin,N,5,-35);
% plot(1:N,[w,w1,w2]); axis([1 N 0 2]);
% legend('Blackman-Harris','Gaussian','Taylor');
%
% See also BARTLETT, BARTHANNWIN, BLACKMAN, BLACKMANHARRIS, BOHMANWIN,
% CHEBWIN, GAUSSWIN, HAMMING, HANN, KAISER, NUTTALLWIN, PARZENWIN,
% RECTWIN, TAYLORWIN, TRIANG, TUKEYWIN, WINTOOL.
% Author(s): P. Costa
% Copyright 1988-2008 The MathWorks, Inc.
% $Revision: 1.14.4.2 $ $Date: 2008/07/09 18:13:44 $
if nargin == 0,
wintool;
w = [];
else
% Create an N-point window specified in wname
error(nargchk(2,inf,nargin,'struct'));
% Function handle and order are required
w = feval(wname,N,varargin{:});
if nargout > 0,
varargout{1} = w;
end
% [EOF]
end
2 Comments
Answers (0)
See Also
Categories
Find more on Windows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!