MATLAB: Plotting Infinite series in matlab #infinite sigmaMATLABMATLAB and Simulink Student Suiteplot e(t)=x(t)-xn(t), how can i plot e(t)?? Best Answer 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. errorn=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 tox=(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); Related SolutionsMATLAB: How to plot different graphs for each iteration of a for loop Put the "figure" command at the start of the for loop.doc figurefor details.Also, in the lineA=(1/T)*quadgk(@g,0,T);you don't want the "@". It should be justA=(1/T)*quadgk(g,0,T); MATLAB: How do we plot this… If you have the symbolic toolbox, use dsolve Related QuestionUse MATLAB to write a code (m-file) to sample the signal:Quad with parameterHow to plot periodic signals
Best Answer