1. Math
  2. Advanced Math
  3. matlab program...

Question: matlab program...

Question details
MatLab Program
Infinite Series Trigonometric functions are usually calculated oncomputers using truncated infinite series. An infinite series is an imfinite setoftemms whose sum is a particular function or expression. For example, the infinite series used to evaluate the sine of a number sin(a) where xis in units of radians. Since a computer does not have enough memory(ortime, obviously) to add an infinite number of terms for every sine that is calculated,the infinite series truncates after a finite number of terms, determined by a pre-defined precision. represents the number of For program 4, write a MATLAB program that prompts for and then prompts for a precision. Determine the number of terms required to evaluate the sine for the given precision as compared to MATLABs sin0) function is also in units of radians). For each iteration, output the current value of the series asshownin the Sample Output. s to Note: 1. The MATLAB command for mis pi The MATLAB command for sine in radians is sinA) 2. The MATLAB command for factorial is factoriap) 3, Convert degrees (deg) to radians using Masabs 4. You are required to use a while loop to detenmine the calculated sine (infinite 5. When calculating the threshold value (actuaisine-seriessine in your while loop use the absolute value of the diference: abspx) 6. Terms in the series altermate SIGN.Allodd number temms are positive, and even number terms are negative, determine if you ADD or SUBTRACT. For example, is the fourth term in the sine SUBTRACTED from the current seriessine. series, therefore it is 7. The power and the subsequent factorial both increase by factors of 2. the current power or each iteration of the while loop by adding 2 each time. Sample output Enter the degrees for which to find the sine:270 Enter the precision for the infinite sine series: 001 Actual sin 270-degrees 1.000000 Current value of Sine series is4712389 Current value of Sine series is 12.728642 Current value of Sine series is 6636667 Current value of Sine series is-3602330 Current value of Sine series is 0A44366 Current value of Sine series is 1081890 Current value of Sine series is 0.991139 Current value of Sine series is Actual sin 270 degrees -1000000 Series sin 270 degrees0 -1000735 using8 terms
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution