Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MATLAB program that will compute an approximation of the sin of a value using the Taylor senies expansion. The Taylor series expansion of

image text in transcribed
image text in transcribed
Write a MATLAB program that will compute an approximation of the sin of a value using the Taylor senies expansion. The Taylor series expansion of the sin tunction is sin(x)=x3!x3+5!x57!x7+=n=0(2n+1)!(1)nx2n+1 And can be approximated by using an upper limit of N rather than infinity on the summation. The program should 1. Read in the value of x and the value of N from the user using MATLAB s s inputfunction 2. Compute the approximation of the sin(x) using N+1 terms in the summation. The approximation should be computed using array operations rather thian Beration. MMATLAB has a buth in sum function that will sum all the elements in an array and a buit in factor fal function that will compute the factonar of: Whole number greater than equal to zero) 3. Display the resuit of the sin(x) approximation. 4. Calcuate the percent diffenece, your approximation minus the value calculated using sin(x), divide by singo then munple with 100 XRead in the value of x and the value of M fron the user usiag MatLaB's Inputfunction 2x - Input ('Please input x '): 3 N- input("please input N '): 4 Again, we will hand code this two for MatLAg Geadief x=pI/2: N=10; Mienerate N+1 terms between to N 7. n= 16 I WConpute the approxfmation of the sin(x) using n+1 tang in the surnation. The approkination should be coeputed asing array operat 1) indpprox: 14 16. farintifint diffpercentr

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

Students also viewed these Databases questions

Question

Find the value of for each k N. xjd(, ,An) B(0)

Answered: 1 week ago