Question
someone please do this corrcetly using matlab and following all instructions
1. (30 Points) It is known that the sine function can be expressed as: x(2k+1) sin(x) = (-1) +(2k + 1)! k=0 Truncate the seri
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the required MATLAB script as the following:

%======================================================================

clear all;
clc;

x = pi/5; % Given x value
k=0:6;    % Given number of terms
sinx_approx = 0; % Initialization of approximation variable
fprintf('# of terms\t Estimate\t\t True Error\t\t   MAPRE\n');
fprintf('----------\t------------\t------------\t------------\n');
for i = k
sinx_approx = sinx_approx + ((-1)^i * (x^(2*i+1))/factorial(2*i+1));
fprintf('\t%d\t\t%0.10f\t%0.10f\t%0.10f\n',i,sinx_approx,abs(sin(x)-sinx_approx),abs(sin(x)-sinx_approx)*100/sin(x));
end

%======================================================================

output:

# of terms Estimate True Error MAPRE -- - on WNHOIT 0.6283185307 0.5869768285 0.5877928810 0.5877852104 0.5877852524 0.587785

Hope this helps!

***************** PLEASE THUMBS UP!!!!!!!!!!!!!!!!! *****************

Add a comment
Know the answer?
Add Answer to:
someone please do this corrcetly using matlab and following all instructions 1. (30 Points) It is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT