Clear Filters
Clear Filters

How do I resolve the error in symbolic computation of Fourier Transform

5 views (last 30 days)
This is the code I am working on:
syms w t
Q_star_hat = fourier(exp(-(t-1)^2),w);
m=fourier(101*(1+exp(-t))*heaviside(t)+2, w);
ufr0star_hat = Q_star_hat/m;
ufr0star = ifourier(ufr0star_hat,t);
fplot(t, ufr0star);
This doesn't give me a plot and instead give me warning and error:
Warning: Error updating ParameterizedFunctionLine.
The following error was reported evaluating the function in FunctionLine update: DOUBLE cannot convert the input
expression into a double array.
How do I resolve it.
  1 Comment
Mohd Hesham AlHafez
Mohd Hesham AlHafez on 3 Jan 2022
I am facing a similar problem. I have gone through plenty of web pages and found nothing. Was you able to solve the problem or not ??

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 3 Jan 2022
syms w t
Q_star_hat = fourier(exp(-(t-1)^2),w);
m=fourier(101*(1+exp(-t))*heaviside(t)+2, w);
ufr0star_hat = Q_star_hat/m;
ufr0star = ifourier(ufr0star_hat,t);
string(t)
ans = "t"
string(ufr0star)
ans = "fourier(exp(- (w + 2i)^2/4 - 1)/(105*pi*dirac(w) + 101/(w*1i + 1) - 101i/w), w, -t)/(2*pi^(1/2))"
u1 = subs(ufr0star, t, 1)
u1 = 
double(u1)
Error using symengine
Unable to convert expression containing remaining symbolic function calls into double array. Argument must be expression that evaluates to number.

Error in sym/double (line 800)
Xstr = mupadmex('symobj::double', S.s, 0);
So what is happening is that your ifourier is giving you back something that does not evaluate to a numeric value when a numeric constant is substituted for t. This is something that cannot be plotted.

Community Treasure Hunt

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

Start Hunting!