Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

** coding in MATLAB!!** Please use the attached sample code to complete this task & use the built in matlab function of cos(x) to compute

** coding in MATLAB!!**
Please use the attached sample code to complete this task & use the built in matlab function of cos(x) to compute its true value.
image text in transcribed
image text in transcribed
The cosine function can be evaluated by the following infinite series (r is in radian): 2k cos(x)-2(-1)" (2kji = 1-21 + -61 + k=0 Step I: Create an M-file and use for loop structure to implement this formula so that it computes nd displays the values of cos(x) as each term in the series is added. In other words, compute and display in sequence the values for 2 cos(x) 1- 2! cos(x) = 1 2! 4! cos(x) = 1--+-- 21 4 6! Up to the order term of your choice. For each of the steps, compute and display absolute true percent relative error as: Error%=abs The value-Approximation value ) 1 00% True value Step 2: Test you program in the following points and write down the value of cos(r and percentage error for each case using 9 term approximation (G.e, up to 16 0.2 09801 0.7 1.25 cos(x) Error%

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_2

Step: 3

blur-text-image_3

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago