필터 지우기
필터 지우기

Plotting truncated FS expansion

조회 수: 8 (최근 30일)
Arman Allahverdi
Arman Allahverdi 2020년 3월 18일
답변: Ayush Gupta 2020년 3월 27일
For the following Y[k], I want to plot y(t) between and :
Where L, C are constants that I've already defined.
I'm trying this:
t=linspace(-pi*10^-3,pi*10^-3);
syms k
y = symsum((1/pi * i * 1000 * sin(pi*k/2))/(1/C + i*1000*k + L(i*1000*k).^2) * exp(i*k*1000*t),k,-99,99);
Which gives the following error:
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression.

답변 (1개)

Ayush Gupta
Ayush Gupta 2020년 3월 27일
The following code is implemented with the assumption of C and L to be 1 as they are constants and it works fine and plots the graph of y.
t=linspace(-pi*10^-3,pi*10^-3);
syms k
y = symsum((1/pi * 1i * 1000 * sin(pi*k/2))/(1 + 1i*1000*k + (1i*1000*k).^2) * exp(1i*k*1000*t),k,-99,99)
plot(t,y)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by