필터 지우기
필터 지우기

(ASAP)why symsum can not calculation?????

조회 수: 1 (최근 30일)
순일
순일 2023년 9월 20일
댓글: Star Strider 2023년 9월 20일
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)
  댓글 수: 1
Star Strider
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)
x1(t) = 
Check = vpa(x1(-2:0.5:2))
Check = 
figure
fplot(x1, [-2 2])
grid
axis([-3 3 0 1])
Warning: Error updating FunctionLine.

The following error was reported evaluating the function in FunctionLine update: Unable to convert expression containing remaining symbolic function calls into double array. Argument must be expression that evaluates to number.
I corrected the ‘x1(t)’ expression to match the image.
.

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

답변 (1개)

Torsten
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
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 CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by