MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
6th Edition
ISBN: 9781119256830
Author: Amos Gilat
Publisher: John Wiley & Sons Inc
bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 34P

34. The Taylor series expansion for sin x about x = 0 is given by:

sin x = x x 3 3 ! + x 5 5 ! x 57 7 ! + .... = n = 0 ( 1 ) n ( 2 n + 1 ) ! x 2 n + 1

where x is in radians. Write a user-defined function that determines sin x using Taylor’s series expansion. For function name and arguments, use y=sinTay (x), where the input argument x is the angle in degrees and the output argument y is the value of sins, inside the user-defined function, use a loop for adding the terms of the Taylor series. If anis the nth term in the series, then the sum Snof the n terms is Sn= Sn-1+ an. in each pass, calculate the estimated error F given by E = S n S n 1 S n 1 . Stop adding terms when E 0.000001 . Since sin θ = sin ( θ ± 360 n ) (n is an integer) write the user- defined function such that if the angle is larger than 360°, or smaller than -360°, then the Taylor series will be calculated using the smallest number of terms (using a value for x that is closest to 0).

Use sinTay for calculating:

(a) sin39° (h) sin205° (c) sin(-70°)

(c) sin 754° (e) sin 19,000° (d) sin(-748°)

Compare the values calculated using sinTay with the values obtained by using MATLAB’s built-in sind function.

Blurred answer

Chapter 7 Solutions

MATLAB: An Introduction with Applications

Ch. 7 - Write a user-defined function that calculates...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Prob. 15PCh. 7 - The area of a triangle ABC can be calculated by:...Ch. 7 - As shown in the figure, the area of a convex...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined MATLAB function that converts...Ch. 7 - Write a user-defined function that plots a...Ch. 7 - Write a user-defined function that plots an...Ch. 7 - Prob. 22PCh. 7 - Write a user-defined function that determines if a...Ch. 7 - The harmonic mean H of a set of n positive numbers...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined function that sorts the...Ch. 7 - Write a user-defined function that sorts the...Ch. 7 - Write a user-defined MATLAB function that finds...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - The shortest distance between two points on the...Ch. 7 - Delta rosette is a set of three strain gages...Ch. 7 - In a lottery the player has to select several...Ch. 7 - 34. The Taylor series expansion for sin x about x...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - The area moment of inertia Ixe of a rectangle...Ch. 7 - The simple RC high-pass filter shown in the figure...Ch. 7 - A circuit that filters out a certain frequency is...Ch. 7 - The first derivative df(x)dx a function f(x) at a...Ch. 7 - In lottery the player has to guess correctly r...
Knowledge Booster
Background pattern image
Statistics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Power Series; Author: Professor Dave Explains;https://www.youtube.com/watch?v=OxVBT83x8oc;License: Standard YouTube License, CC-BY
Power Series & Intervals of Convergence; Author: Dr. Trefor Bazett;https://www.youtube.com/watch?v=XHoRBh4hQNU;License: Standard YouTube License, CC-BY