Using symbolic integration: Undefined function 'int' for input arguments of type 'double'.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Bryan
le 22 Nov 2014
Réponse apportée : Star Strider
le 23 Nov 2014
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 commentaires
Geoff Hayes
le 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?
Réponse acceptée
Star Strider
le 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.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Assumptions dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!