初学者,求教matlab中快速傅里叶变换如何编程序,非常感谢!

2024-12-19 23:05:53
推荐回答(1个)
回答1:

F=fourier(f,t,w)
自己编的话
function F = fuliye(varargin)
if nargin >= 4
error('symbolic:sym:fourier:errmsg1','FOURIER can take at most 3 input variables');
end
f = sym(varargin{1});
var = findsym(f,1);

if isempty(var)
var = sym('x');
end
w_test = strcmp(char(var),'w');
if nargin == 1 & w_test == 1
x = var;
w = 't';
end
if nargin == 1 & w_test == 0
x = var;
w = 'w';
end
if nargin == 2
x = var;
if isempty(x), x = 'x'; end;
w = sym(varargin{2});
end
if nargin == 3
x = sym(varargin{2});
w = sym(varargin{3});
end
F = maple('map','fourier',f,x,w);