- #1

- 383

- 5

Code:

```
x = [1 2 3 4 5];
y2 =[84,86,84,81,84,];
%72,84];
y=[74,85,89,96,99];
plot(x, [y(:) y2(:)])
```

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- MATLAB
- Thread starter Superposed_Cat
- Start date

- #1

- 383

- 5

Code:

```
x = [1 2 3 4 5];
y2 =[84,86,84,81,84,];
%72,84];
y=[74,85,89,96,99];
plot(x, [y(:) y2(:)])
```

- #2

kreil

Gold Member

- 668

- 68

This page explains how to set the axis limits and tick intervals.

http://www.mathworks.com/help/matlab/creating_plots/setting-axis-parameters.html

Since you have discrete data, use the trapz(x,y) or cumtrapz(x,y) functions to calculate the area under each curve. The difference between the two is that trapz() just gives you the final area, whereas cumtrapz gives you the intermediate values as well.

http://www.mathworks.com/help/matlab/math/integration-of-numeric-data.html

http://www.mathworks.com/help/matlab/ref/trapz.html

http://www.mathworks.com/help/matlab/ref/cumtrapz.html

Share:

- Replies
- 3

- Views
- 4K