Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help writing Matlab code and please comment on the work so I could understand thank you Create a function called composite trapezoid that inputs

Need help writing Matlab code and please comment on the work so I could understand thank you

image text in transcribed

Create a function called composite trapezoid that inputs a function, a pair of endpoints, a, b, and a number n of subintervals, and outputs the approximation to the integral of f from a to b using the composite trapezoid rule. Your function header should look like this function Icomposite_trapezoid(f,a, b,n) Use that function to compute the integral I Call I1 and I2 the obtained results. The exact answer to this integral can be computed using the o cos (1 ) dt, for the number of points n = 10, 105 - Fresnel cosine integral in Matlab: fresnelcx)cdt. Cody Coursework might not recognize this function, compute the value on Matlab and copy the result with the LONG format. Compute the error in your computation for each n and for each method. Call Errl and Err2 those errors. Make a loglog plot of error verses the number of points for both methods on the same plot. Comment on the result using % r cos ( ) dt. Cody Courseuork might not recognize you ou o

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions