Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please USE Matlab. 3. The approximation of sine function can be evaluated using the following series: 23 + 25 .22n+1 sin(x) = 2 +(-1) 3!
Please USE Matlab.
3. The approximation of sine function can be evaluated using the following series: 23 + 25 .22n+1 sin(x) = 2 +(-1)" 3! 5! (2n + 1)! Evaluate the above equation using 1 to 10 terms (i.e. n=0:9) and store the values in a variable 'sine'. Then calculate the percent relative error using the below equation: TrueValue - ApproximatedValue error x 100 TrueValue Plot percent relative error vs number of terms used in the approximation (i.e. error vs n). Take x = Hint: 100 Use a for loop to add the terms one by one to the approximation. After each term is added, store the value in a separate indexed variable (eg: approx(i) sine), so that all the information is stored even if the variable 'sine is overwritten ever time the for loop iterates. Matlab built in functions, a) to evaluate the true value, use true = sin(x) b) for factorial, 3! in matlab is written as factorial(3)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started