e(t)=x(t)-xn(t), how can i plot e(t)??

댓글 수: 5

Rupesh Yadav
Rupesh Yadav 2020년 10월 25일
@David Hill how to plot x(t)
Walter Roberson
Walter Roberson 2020년 10월 25일
If you were to plot x(t) would you want it for a single fixed n value, or for a vector of n values like David Hill shows?
If you want a vector of n values then x(t) would have one component for each value in n so you would need a 2D plot.
Rupesh Yadav
Rupesh Yadav 2020년 10월 25일
@Walter Robertson Ya I was asking for the same. Actually we i want to add fourier sine series summation till inf then how to add them and finally plot the same?
Walter Roberson
Walter Roberson 2020년 10월 25일
What is the "same" that you are asking for? Which variables do you want to be fixed in the plot and which do you want want to change? If you have more than one changing variable then which do you want for x, which for y, which for z?
Walter Roberson
Walter Roberson 2020년 10월 25일
Adding an infinite number of terms takes an infinite time, and there is never a "finally" for an infinite time.

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

 채택된 답변

David Hill
David Hill 2019년 11월 14일

0 개 추천

You can plot for various values of t between 0 and 1.
t=.3%not sure what you want to plot against, I held t constant and plotted N vs. error
n=1:2:100000;%have to pick something for infinity (100,000 should be good for about 5 decimal places)
N=1:2:500;%whatever you want N to go up to
x=(4/pi)*sum((1./n).*sin(n*pi*t));
e=arrayfun(@(y)x-(4/pi)*sum((1./(1:2:y)).*sin((1:2:y)*pi*t)),N);
plot(N,e);

댓글 수: 1

Maryam Albuhayr
Maryam Albuhayr 2024년 5월 25일
how can i plot this
by having some values for x and t. such as
x=0:h:1;
t=0:k:0.06;

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

추가 답변 (0개)

카테고리

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

질문:

2019년 11월 14일

댓글:

2024년 5월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by