Conversion to double from sym is not possible.

2 views (last 30 days)
w=pi/2;
c = (0.25)*(exp(-j*n*w*t).*(2*t-4)./(j*n*w) + 2*j.*(sin(4*w*n)-sin(2*w*n))./(n*w).^2);
syms n c t;
F=symsum(c*exp(j*n*w*t),n,-N,N);
t=-6:0.1:6;
plot(F,t);
i need this fourier series plotted for the values of N=1,9,99,999 but it is giving "Conversion to double from sym is not possible." error. . how can i make this right??

Answers (1)

Walter Roberson
Walter Roberson on 29 Oct 2015
syms n c t;
w = pi/2;
c = (0.25)*(exp(-j*n*w*t).*(2*t-4)./(j*n*w) + 2*j.*(sin(4*w*n)-sin(2*w*n))./(n*w).^2);
F = symsum(c*exp(j*n*w*t),n,-N,N);
T = -6:0.1:6;
F1 = subs(F,t,T);
plot(T, F1)
However, this will fail because you have not defined N. If you define N as symbolic then it will fail as F1 will contain the symbolic N.
  1 Comment
muge cankurtaran
muge cankurtaran on 29 Oct 2015
i am gonna give N the values 1, 9, 99, 999 in order. but it still doesnt work. so are you saying that there is no chance i can plot this?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!