Question: Problem 2 (MATLAB): (i) Using MatLab, find the first 21 coefficients Q, and f the Fouries series in terms of sines and cosines, of the

Problem 2 (MATLAB): (i) Using MatLab, find the first 21 coefficients Q, and f the Fouries series in terms of sines and cosines, of the discontinuous top-hat function (what is L). Consicer the truncated series g(z, Nina.) which converges to the starting function in the Nmax oo limit, an cos Show visually how including more and more terms improves the convergence, by plotting (10) Hints: The Matlab expression for a definite integrsin (), is int (sin (z) 0, 1) You can have the code compute all the 21 Fourier coefficients through 21 Or, more efficiently, you an introduce alint = a(n) int(. . .) b-(n) int.) (12) where instead of. you have to write the corresponding definite integral for that coefficient. The term a0 is introduced as a number, while and b 88 a functions of n that will be evaluated later for given values of n (remember to add the line that introduces and n a8 variables; if you later need to introduce a do, cycle, do not call the loop variable 'n'). Then the Matlab expression fr the partial series 5-1 akcs( kr) i8 put a name = (z) symsum(a(k) * cos(. . . kr), k, 1,5) (13) Problem 2 (MATLAB): (i) Using MatLab, find the first 21 coefficients Q, and f the Fouries series in terms of sines and cosines, of the discontinuous top-hat function (what is L). Consicer the truncated series g(z, Nina.) which converges to the starting function in the Nmax oo limit, an cos Show visually how including more and more terms improves the convergence, by plotting (10) Hints: The Matlab expression for a definite integrsin (), is int (sin (z) 0, 1) You can have the code compute all the 21 Fourier coefficients through 21 Or, more efficiently, you an introduce alint = a(n) int(. . .) b-(n) int.) (12) where instead of. you have to write the corresponding definite integral for that coefficient. The term a0 is introduced as a number, while and b 88 a functions of n that will be evaluated later for given values of n (remember to add the line that introduces and n a8 variables; if you later need to introduce a do, cycle, do not call the loop variable 'n'). Then the Matlab expression fr the partial series 5-1 akcs( kr) i8 put a name = (z) symsum(a(k) * cos(. . . kr), k, 1,5) (13)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
