Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help on this exercise. Can we use a for loop ? (Matlab) (Matlab) Exercise 1 Consider the following integral of a function f(x) on

Need help on this exercise. Can we use a for loop ? (Matlab)

(Matlab)

image text in transcribed

Exercise 1 Consider the following integral of a function f(x) on a finite interval [a,b] I(f)f(x)dx. CL Write three Matlab/Octave functions implementing, respectively, the composite midpoint rule, the composite trapezoidal rule, and the composite Simpson rule to compute the numerical approxima- tion of I(f). Such functions should be of the form function [I]-int.midpoint.rule(fun,a,b,n)(composite midpoint rule) function [I]-int trapezoidal rule(fun,a,b,n) (composite trapezoidal rule) function [I]-int Simpson rule(fun,a,b,n) (composite Simpson rule) Input: function handle representing f (x) a,b: endpoints of the integration interval n: number of evenly-spaced points in [a, b (including endpoints) Output: I: numerical approximation of the integral (1) Exercise 1 Consider the following integral of a function f(x) on a finite interval [a,b] I(f)f(x)dx. CL Write three Matlab/Octave functions implementing, respectively, the composite midpoint rule, the composite trapezoidal rule, and the composite Simpson rule to compute the numerical approxima- tion of I(f). Such functions should be of the form function [I]-int.midpoint.rule(fun,a,b,n)(composite midpoint rule) function [I]-int trapezoidal rule(fun,a,b,n) (composite trapezoidal rule) function [I]-int Simpson rule(fun,a,b,n) (composite Simpson rule) Input: function handle representing f (x) a,b: endpoints of the integration interval n: number of evenly-spaced points in [a, b (including endpoints) Output: I: numerical approximation of the integral (1)

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_2

Step: 3

blur-text-image_3

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

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

More Books

Students also viewed these Databases questions