This is a MATLAB question. Thank you for your time.
Calculating Error There are different methods to quantify error of the FSE such as the Root Mean Square Error (RMSE) and Max Error. Root mean square error is calculated using this formula: i 0 Max error is calculated using this formula: Note that facr is the actual or original function, and fFSE is the Fourier series expansion of this function. Assignment: For the following functions compute the Fourier series: 1) fi(z) - sin (ar) if a) Write down the integral formula to find the coefficients of the Fourier Series for each function; use the period- z r. b) Write two separate MATLAB functions (named funel and func2, corre- sponding to the two given functions above) that takes as input the desired number of Fourier terms (N), and computes and returns the Fourier series coefficients. Write a MATLAB script file for the following three parts. c) Inside the script, call the two function created in part b to estimate the FSE coefficients for N 5, 10, 50, 100. In two separate graphs (one corresponding to each function), plot the actual function and their FSE for N = 5 and N-100. For the plots use 100 equally spaced points in the range -2r sIS2m d) In your MATLAB script compute the RMSE and MAX Error for the FSE's of each function with N = 5, N 10, N 0, N 100. Plot the RMSE vs. N and MAX error vs. N in a separate graph for each function. Submission Instructions: . A zipped folder containing all the submission files (MATLAB script and function files and the figure files) should be uploaded to UBLearns. Name the zipped package as. "Lab4.person#.zip- Calculating Error There are different methods to quantify error of the FSE such as the Root Mean Square Error (RMSE) and Max Error. Root mean square error is calculated using this formula: i 0 Max error is calculated using this formula: Note that facr is the actual or original function, and fFSE is the Fourier series expansion of this function. Assignment: For the following functions compute the Fourier series: 1) fi(z) - sin (ar) if a) Write down the integral formula to find the coefficients of the Fourier Series for each function; use the period- z r. b) Write two separate MATLAB functions (named funel and func2, corre- sponding to the two given functions above) that takes as input the desired number of Fourier terms (N), and computes and returns the Fourier series coefficients. Write a MATLAB script file for the following three parts. c) Inside the script, call the two function created in part b to estimate the FSE coefficients for N 5, 10, 50, 100. In two separate graphs (one corresponding to each function), plot the actual function and their FSE for N = 5 and N-100. For the plots use 100 equally spaced points in the range -2r sIS2m d) In your MATLAB script compute the RMSE and MAX Error for the FSE's of each function with N = 5, N 10, N 0, N 100. Plot the RMSE vs. N and MAX error vs. N in a separate graph for each function. Submission Instructions: . A zipped folder containing all the submission files (MATLAB script and function files and the figure files) should be uploaded to UBLearns. Name the zipped package as. "Lab4.person#.zip