MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
5th Edition
ISBN: 9781118629864
Author: Amos Gilat
Publisher: WILEY
bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 23P

The Taylor series expansion for cos(x) is:

cos x = 1 x 2 2 ! + x 4 4 ! x 6 6 ! + ... = n = 0 1 n 2 n ! x 2 n

wherex is in radians. Write a MATLAB program that determines cos(x) using the Taylor series expansion. The program asks the user to type a value for an angle in degrees. Then the program uses 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 S n = S n 1 + a n . In each pass calculate the estimated error E given by E = S n S n 1 S n 1 . Stop adding terms when E 0.000001 . The program displays the value of cos(x). Use the program for calculating:

  1. Cos(35°)
  2. sin(125°)

Compare the values with those obtained by using a calculator.

Blurred answer

Chapter 6 Solutions

MATLAB: An Introduction with Applications

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
Text book image
Algebra for College Students
Algebra
ISBN:9781285195780
Author:Jerome E. Kaufmann, Karen L. Schwitters
Publisher:Cengage Learning
But what is the Fourier Transform? A visual introduction.; Author: 3Blue1Brown;https://www.youtube.com/watch?v=spUNpyF58BY;License: Standard YouTube License, CC-BY