Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

function[c]= mysin(x); x; % any given value within range y = -x*x; % ; means do not print output S = 1; for n=7:-2:3 S

function[c]= mysin(x); x; % any given value within range y = -x*x; % ; means do not print output S = 1; for n=7:-2:3 S = S*y/(n-1) + 1; end S = S*x

Here is the mfileimage text in transcribed

The posted program "Horner's algorithm for sin(x)" computes sin(x) to within 0.0001 fr any x with x 2. a) Create an m-file with name mysin that executes this program when mysin(x) is typed into the command window; b) Write a matlab program that uses the program mysin(x) to compute sin(x) for all numbers x within the range of any 64 bit computer. (See p. 67-68 of the text.) c) Compare the output of your program for 2445 with the output of mathlab function sin(x). Explain any discrepencies. The posted program "Horner's algorithm for sin(x)" computes sin(x) to within 0.0001 fr any x with x 2. a) Create an m-file with name mysin that executes this program when mysin(x) is typed into the command window; b) Write a matlab program that uses the program mysin(x) to compute sin(x) for all numbers x within the range of any 64 bit computer. (See p. 67-68 of the text.) c) Compare the output of your program for 2445 with the output of mathlab function sin(x). Explain any discrepencies

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

Define marketing concepts.

Answered: 1 week ago

Question

1 what does yellow colour on the map represent?

Answered: 1 week ago