Question: How to write a matlab function that approximate sine within tolerance? Write a function with the following header: function [approx, n] = my_sin_approx_tolerance(x, tolerance) where:

How to write a matlab function that approximate sine within tolerance?  How to write a matlab function that approximate sine within tolerance?

Write a function with the following header: function [approx, n] = my_sin_approx_tolerance(x, tolerance) where: x is a scalar of class double that represents the value of x in Equation 2. You can assume that x is neither NaN, Inf, nor -Inf. tolerance is a scalar of class double that is greater than zero and that is neither NaN nor Inf. n is a scalar of class double that represents the smallest possible value of n such that the approximation of sin(x) as calculated by Equation 2 is within tolerance of the value calculated by Matlab using sin(x). approx is a scalar of class double that represents the approximation of sin (x) as calculated by Equation 2, where n is equal to n Test cases: >>[approx, n] = my_sin_approx_tolerance(pi/3, 1e-2) approx - 0.8663

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!