Using symbolic integration: Undefined function 'int' for input arguments of type 'double'.

1 次查看(过去 30 天)
Hello, I am trying to write a program that will allow me to approximate the Fourrier transform of an input function, an impulse response function, and find the output function using symbols for t and w0. When using the int function for my t symbol I get no errors. However with the w symbol I get the error in the question title. Here is my code, can someone tell me what I am doing wrong?
clf;
clear all;
syms t w0
x = exp(-3*t)*heaviside(t);
h = exp(-2*t)*heaviside(t);
integrand_x = x*exp(-1j*w0*t);
integrand_h = h*exp(-1j*w0*t);
X = int(integrand_x, t, -10000, 10000);
H = int(integrand_h, t, -10000, 10000);
Y = H*X;
integrand_y = Y*exp(1j*w0*t);
y = int(integrand_y, w0, -10000, 10000);
y = y/(2*pi);
ezplot(y, [-5, 0.01, 5]);
axis([-5 5 -1 1]);
  2 个评论
Geoff Hayes
Geoff Hayes 2014-11-23
Bryan - is integrand_y a symbolic expression or a double? What is w0? In the Command Window type
class(w0)
class(integrand_y)
What is returned from each of these two calls?

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2014-11-23
The problem is that the Symbolic Math Toolbox found it impossible to do the inverse Fourier transform of your function. The result stays as ‘int(...)’ and ezplot cannot evaluate it in that form. That is what is throwing the error.
The essence of the problem itself may be that your initial functions are asymmetric by design — they only exist on the time interval [0,T] (because of the Heaviside step function) rather than being symmetric about 0 and existing on [-T T]. Symmetry has many attractive mathematical qualities, among them being that difficult terms cancel, leaving a much easier problem. Asymmetric functions do not have these characteristics, making them occasionally difficult to evaluate in the Fourier domain and occasionally impossible to invert.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by