I'm trying to calculate areas between individual x values underneath my current plot, from the code below;
clearclcx = [0 1 2 3 4 5 6 7 8 9 10 11 12];y = -[0 -0.5 -0.8 -0.8 -1 -1.1 -1.2 -1.2 -1.4 -1.2 -1.1 -1 0]; plot (x,y,'r')area (x,y)An = (trapz(x,y));
How would I calculate and store values of the area between the ranges of 0 to 1, 1 to 2 etc. onwards, whilst relating it still to the original matrix its attached to? Would it be also possible to return this value for the areas as a matrix the same size as x and y?
Any help would be appreciated,
Thanks.
Best Answer