Need help in matlab code.
Write a MATLAB program (script) which creates an animation showing how the Fourier series evolves as more terms are added to the sum. The user will input an equation for the Fourier series coefficients, Gn and the maximum number of terms, Nmax to process. The sequence of plots will show the signal g(t). Notes 1. Use the exponential Fourier series. For each plot in the animation use symmetric limits in the summation, e.g. n 5 to +5, so the result is real-valued (assuming the Fourier series coefficients have the appropriate symmetry). 2The user will input the equation, Gn, as text, for example Equations with special cases can be input by including logical expressions, for example 3. Use good programming style. Include comments. 2.5*sinc(n/2) 2.5*sinc(n/2) + (n--0)*3 Hints 1. The signal g() may have a very small imaginary component because of finite-precision arithmetic. Th the real part, but to avoid masking problems in the program it is good to check that the imaginar part is very small. is will cause a warning message when plotting. To avoid this error message plot 2. An equation can be input as a character vector and then converted to a function using "vectorize" and "str2func". Hint: for initial testing it might be convenient to instead use an anonymous function or assign the character vector to some predefined value and comment out the input statement. 3. Test the program using known signals such as examples from the text. Certain programming errors will not affect symmetric signals so be sure that testing includes a signal which is not symmetric. 4. You may prompt the user to enter To or you may normalize the time axis to be t/To Write a MATLAB program (script) which creates an animation showing how the Fourier series evolves as more terms are added to the sum. The user will input an equation for the Fourier series coefficients, Gn and the maximum number of terms, Nmax to process. The sequence of plots will show the signal g(t). Notes 1. Use the exponential Fourier series. For each plot in the animation use symmetric limits in the summation, e.g. n 5 to +5, so the result is real-valued (assuming the Fourier series coefficients have the appropriate symmetry). 2The user will input the equation, Gn, as text, for example Equations with special cases can be input by including logical expressions, for example 3. Use good programming style. Include comments. 2.5*sinc(n/2) 2.5*sinc(n/2) + (n--0)*3 Hints 1. The signal g() may have a very small imaginary component because of finite-precision arithmetic. Th the real part, but to avoid masking problems in the program it is good to check that the imaginar part is very small. is will cause a warning message when plotting. To avoid this error message plot 2. An equation can be input as a character vector and then converted to a function using "vectorize" and "str2func". Hint: for initial testing it might be convenient to instead use an anonymous function or assign the character vector to some predefined value and comment out the input statement. 3. Test the program using known signals such as examples from the text. Certain programming errors will not affect symmetric signals so be sure that testing includes a signal which is not symmetric. 4. You may prompt the user to enter To or you may normalize the time axis to be t/To