Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HW6P2 (15 points) The following are infinite series representations of the functions sine and cosine along with the exponential. n+1 sin(x)-?(-1) (2n + 1)! n-0

image text in transcribed

HW6P2 (15 points) The following are infinite series representations of the functions sine and cosine along with the exponential. n+1 sin(x)-?(-1)" (2n + 1)! n-0 7L cos(x)-? (-1)" (2n)! rl n-0 Performing the summation only to N terms is called a partial sum and is denoted Sv. 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(/3) b) cos(/4) c) e Assuming that MATLAB sin (), cos and exp ) functions return exact values of the functions, calculate the absolute difference between the value of the function determined by your code and that determined by the built-in functions of MATLAB and assign this difference to a variable name Error. The error term vanishes as N increases. For every function, (sin, cos and e). Your display in the command window for part (a) must be shown as: PART S(1) S(2) a) sin (pi/3) -0.8558007816, -0.8662 952838, Error 1.022462221932130E-02. = Error 2.698800023961390E-04 = Use fprintf inside the loop with format i for N (1, 2, .., 5) and format.10f for the value of Sw and format.15E for the Error Hint: 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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

When can you use a TM or an on your product?

Answered: 1 week ago