How to calculate and plot area under the curve using trapz or other appropriate function?!

63 views (last 30 days)
I am trying to find and visualise the area under the curve for my data (see below) in order to compare to similar learning curve data. I have tried some ways but unsure if they are the most appropriate or have worked correctly as the data is negative and not smooth.
Any help would be much appreciated (still trying to learn the ropes with matlab).
Thanks
x y
1 -55.162559
2 -51.49817
3 -46.321619
4 -43.674017
5 -37.015529
6 -33.266756
7 -33.052172
8 -30.351532
9 -25.077227
10 -24.418889
11 -24.699318
12 -23.214323
13 -18.825947
14 -19.187909
15 -19.950888
16 -21.360635
17 -16.625949
18 -14.793957
19 -14.95093
20 -16.379339
21 -15.486643
22 -16.368055
23 -16.931243
24 -13.441767
25 -12.510163
26 -12.067308
27 -13.764358
28 -15.241232
29 -15.239815
30 -11.739023
31 -11.895491
32 -10.73586
33 -14.062533
34 -12.332744
35 -11.66472
36 -11.918313

Accepted Answer

madhan ravi
madhan ravi on 10 Dec 2018
area(Y,X)
trapz(X,Y)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!