Answered step by step
Verified Expert Solution
Question
1 Approved Answer
!!! PLEASE USE MATLAB IN FINDING CODES FOR THIS QUESTION !!! !!! ALSO INCLUDE OUTPUT AT THE END !!! !!! I UPVOTE FAIRLY !!! !!!
!!! PLEASE USE MATLAB IN FINDING CODES FOR THIS QUESTION !!! !!! ALSO INCLUDE OUTPUT AT THE END !!!
!!! I UPVOTE FAIRLY !!!
!!! PLEASE TEACH ME SO I CAN UNDERSTAND (PUT COMMENTS) !!!
21.2 Write a well-commented MATLAB function program myints whose inputs are f, a, b and n and whose outputs are L, R and T, the left, right and trapezoid integral approximations for fon (a, b) with n subintervals. To make it efficient, take advantage of the fact that Ar; is constant, use x - linspace(a,b,n+1) to make the r values, use y = f(x) to make the y values, use slice and sum to add the 2nd to nth y entries once, and then add on the missing terms to obtain the left, right and trapezoid approximations. Change to format long and apply your program to the integral i vode. Compare with the results of the previous exercise. Also find L100, R100 and T100 and the percentage errors of these approximations. Turn in the program and a brief summary of the results
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