# Integration exercises

Exercises

## 1. Area estimation

Using Matlab to estimate the percentage of the area of the shape in the box.

## 2. Integration

Consider the function $f(x) = 5 \cdot e^{-(x-3)^2}$ . Write a Matlab program which

• asks the user to enter values xmin and xmax;
• (optional) plots this function from xmin to xmax using a logarithmic y-axis;
• calculates the area under this curve between xmin and xmax.

Note: Use "input" to request user input in MATLAB. see http://www.mathworks.com/help/techdoc/ref/input.html for the documentation of input.

Request a text response. Assign a default value ('Y') by checking for an empty matrix.

  reply = input('Do you want more? Y/N [Y]: ', 's');