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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Geoff Hayes
Geoff Hayes il 23 Nov 2014
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?
Bryan
Bryan il 23 Nov 2014
This is the result when I use those two commands:
>> class(w0)
ans =
sym
>> class(integrand_y)
ans =
sym

Accedi per commentare.

Risposta accettata

Star Strider
Star Strider il 23 Nov 2014
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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by