Hi,
I am trying to plot the x(t) and t should be between -3 to 3. I calculate the a_k and I used the code given below. However, I could not get the plot what I expect. Capital T should be equal to 2. What is wrong in these lines? Thank you very much.
f=0;
t=linspace(-3,3);
for k=-100:1:100
a_k= (((pi^2)*(k^2)*(1^2)-2*(pi^2)*(k^2)-2*(2^2).*sin((k*pi*1/2))+2*pi*k*2*1.*cos((k*pi*1/2)))/2*(pi^3)*(k^3));
f=f+a_k*(exp(j*2*pi*k*t/2)); % for T=2
end
figure;
plot(t,f);

댓글 수: 1

Sharmin Kibria
Sharmin Kibria 2021년 6월 25일
Hi,
Can you write down the mathematical expression you are using for calculating the values of a_k? It will easier for me check if it getting calculated correctly.
Thanks
Sharmin

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2021년 6월 24일

댓글:

2021년 6월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by