Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following are infinite series representations of the functions sine, cosine, and the exponential. 2n+1 sin(x)-? (-1) n=0 2n cos(x) - ()m (2n)! n=0 7l

image text in transcribed

The following are infinite series representations of the functions sine, cosine, and the exponential. 2n+1 sin(x)-? (-1)" n=0 2n cos(x) - ()"m (2n)! n=0 7l Performing the summation only to N terms is called a partial sum and is denoted by SN. 1l n=0 Within your script file, use nested for loops to compute the first 5 partial sums with N-1, 2, 3, 4 and 5 in order to estimate the following a) sin(T/3) b) cos(t/4) c) e Assuming that the built-in MATLAB functions sin ),cos (), and exp () return the exact values, calculate the absolute difference between the value of the function determined by your code and the MATLAB function. Print out your results, and ONLY your results, to the command window as seen below where S(N) is the partial sum out to N values. PART a) sin (pi/3) ->MUST INCLUDE THIS LINE IN YOUR OUTPUT S (1) 0.8558007816, Error -1.022462221932130E-02 S (2) 0.8662952838, Error2.698800023961390E-04 S(-) = , Error = - S(-) = , Error - HINT: Use fprintf inside the outside loop with format i for N (1, 2,..., 5), format.10f for the value of Sw, and format. 15E for the absolute error. You can use the MATLAB function factorial () to determine the factorial; however, DO NOT use the sum () function in MATLAB

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions