# Matlab integral

Not what you're looking for? Search our solutions OR ask your own Custom question.

Write a function to calculate the integral from a to b of f(x) dx using the composite trapezoid rule with n equal subunits. test the code on a) the integral from 0 to pi of sin(x), b) the integral from 0 to 1 of exp(x) and c) the integral from 0 to 1 of arctan(x). Provide the codes used and all the results and work.

Â© BrainMass Inc. brainmass.com March 4, 2021, 9:06 pm ad1c9bdddfhttps://brainmass.com/math/integrals/numerical-analysis-problem-using-matlab-217468

#### Solution Preview

Please find the solution and the MATLAB code in the attached file. The example of how to use the MATLAB code is shown in the .doc file. ...

#### Solution Summary

This provides an example of using Matlab to calculate an integral using composite trapezoid rule.

$2.49