Conversion to double from sym is not possible.
2 views (last 30 days)
Show older comments
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??
0 Comments
Answers (1)
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.
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!