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?
Bryan
Bryan 2014년 11월 23일
This is the result when I use those two commands:
>> class(w0)
ans =
sym
>> class(integrand_y)
ans =
sym

댓글을 달려면 로그인하십시오.

채택된 답변

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