Plotting Infinite series in matlab
15 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248151/image.png)
e(t)=x(t)-xn(t), how can i plot e(t)??
5 个评论
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
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
2019-11-14
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
2024-5-25
how can i plot this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1703826/image.png)
by having some values for x and t. such as
x=0:h:1;
t=0:k:0.06;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!