I have written a function in MATLAB that uses the WINDOW function from the Signal Processing Toolbox (in this example, I call the WINDOW function with the BLACKMAN window type). Why do I receive an error?
Reproduction steps:
N = int32(2048);awin = window(@blackman,N)
Resulting error message:
Undefined function 'cos' for input arguments of type 'int32'. Error in gencoswin>calc_window (line 90) w = 0.42 - 0.5*cos(2*pi*x) + 0.08*cos(4*pi*x); Error in gencoswin>sym_window (line 59) w = calc_window(half,n,window); Error in gencoswin (line 46) w = sym_window(n,window); Error in blackman (line 17) [w,msg,msgobj] = gencoswin('blackman',varargin{:}); Error in window (line 54) w = feval(wname,N,varargin{:});
Best Answer