Hello,

I am trying to find the area as a part of a graph( Red area in the picture below). I am asking here a simplified question of my complext problem. The area is definitely 0.5. However, when I am using "trapz" function, It is giving me 4.5.

`x=[0 1 2 3 4 5 10 15 20];y=[0 -1 -2 -3 -4 -5 0 5 0];plot(x,y)area=trapz(4:5)`

Thanks, Frite

## Best Answer