why "symsum(si​n(k*pi)*k,​0,n)" not equal zero

답변 (3개)

Walter Roberson
Walter Roberson 2014년 2월 23일

1 개 추천

symsum(sin(k*sym('pi'))*k,0,n)
Remember, "pi" in MATLAB is only a numeric approximation to the transcendental number; you need to use the transcendental number rather than the numeric approximation.
Jan
Jan 2014년 2월 23일

0 개 추천

What is n? For e.g. n=0.5 the result is not surprising.
Paul
Paul 2014년 2월 23일

0 개 추천

I don't think Matlab recognizes that sin(pi)= 0, therefore it cant simplify further sin(pi*n)*(n/2 + 1/4). Just type sin(pi) and you will see you won't get 0. sind(180) does give 0 but sind doesn't support symbolic variables.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2014년 2월 23일

답변:

2014년 2월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by