How to Plot Truncated Summation Functions without any add-ons
6 次查看(过去 30 天)
显示 更早的评论
Hello, I'm trying to figure out how to go about plotting a truncated summation function such as
without the use of any add-ons. Almost every resourse I'm finding for Matlab requires a toolbox add-on that I do not have access to, such as PDF from the stats/machine toolbox, or syms from the symbolic math toolbox. If anyone could give a hint on how to approach this, I would apprectate it.
0 个评论
回答(1 个)
David Hill
2022-2-20
y=@(M,x)2/pi*sum((-1).^((1:M)-1).*cos(2*(1:M)-1)*pi/2.*x'./(2*(1:M)-1),2)+0.5;
x=-10:10;
plot(x,y(3,x),x,y(10,x),x,y(20,x));%plot vs. different values of M
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!