(ASAP)why symsum can not calculation?????
1 回表示 (過去 30 日間)
古いコメントを表示
t = (-2:0.5:2);
a=1;
x1=1/2 + symsum((1/2)*(sinc(a/2))*cos(2*pi*a*t)/4,a,1,inf);
plot(t,x1)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1488172/image.png)
1 件のコメント
Star Strider
2023 年 9 月 20 日
It cannot be calcualted because you are not using symbolic calculations.
Perhaps this —
syms a t
% t = sym(-2:0.5:2);
% a=1;
x1(t) = 1/2 + symsum((1/2)*(sinc(a/2))*cos(2*pi*a*t/4),a,1,inf);
x1 = simplify(x1, 500)
Check = vpa(x1(-2:0.5:2))
figure
fplot(x1, [-2 2])
grid
axis([-3 3 0 1])
I corrected the ‘x1(t)’ expression to match the image.
.
回答 (1 件)
Torsten
2023 年 9 月 20 日
編集済み: Torsten
2023 年 9 月 20 日
t = -2:0.1:2;
a = 1;
N = 60;
n = (1:N).';
f = sinc(n/2).*cos(2*pi*a*n.*t/4);
s = 0.5 + sum(f,1);
plot(t,s)
1 件のコメント
Dyuman Joshi
2023 年 9 月 20 日
Different output for the original summation (1 to Inf)
And if the number of elements of t are increased, the code does not run in the time limit here.
t = -2:2;
syms a
x1 = 1/2 + symsum((1/2)*(sinc(a/2))*cos(2*pi*a*t)/4,a,1,Inf);
plot(t,x1)
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!