Assignment 1
part_sum_c.m
. This can be used to plot trigonometric
polynomials of the form
y(t) = a0 + a1cos(t)+ b1sin(t) + a2cos(2t)+ b2sin(2t) + ... + ancos(nt)+ bnsin(nt)
In the m-file (program), the arguments are as follows:
- a = [1,2,0,0];
- b = [3,0,-1];
- t = linspace(0,4*pi,500);
- y = part_sum_c(a,b,t);
- plot(t,y)
- xlabel('t'), ylabel('y'), title('y=1+2cos(t)+3sin(t)-sin(3t)')
Be careful about the backquote ' . This needs to be in the code; it
indicates the start and finish of a character string. Check the Matlab
documentation for exporting the figure. Include the plot in your
homework. Do the same for these trigonometric polynomials: