Hello
I want to find the area under the curve plotted below. I am trying to figure out why the cumsum and sumtrapz are not giving me the same answer. I read some of the help in matlab, However i am still confussed why i cant get the same answer using both the keywords.
clcclear allclose allx=4.5:0.1:9;y=-2*x + 20;plot(x,y)Area1=cumtrapz(x,y);Area2=cumsum(y);figure(1)plot(x,Area1)figure(2)plot(x,Area2)
Best Answer