I'm quite new to Mathematica. I need to calculate the area below many curves imported from excel.
I wrote this code:
curve={{{0,0},{0.1,1},{0.2,10},{0.22,20},{0.3,50},{0.4,20}},{{0,0},{0.15,5},{0.25,10},{0.27,20},{0.3,40},{0.5,30}}};
(plot) dataPlot =Table [ListLinePlot[l, PlotRange -> All], {l, curve}]
(find the interpolating curves) f = Table[Interpolation[l, InterpolationOrder -> 1], {l, curve}];
I've originally written the code for one curve, and I don't know how to write this last part of the code for n curves:
Plot[f[t], {t, 0, Max@x}]
NIntegrate[f[t], {t, 0, Max@x}]
I would also need to calculate the areas between 0 and the x values which correspond to the maximum y values
Thank you in advance!
curve[[1]]
andcurve[[2]]
? Specifically, why are you trying to interpolate first and then useNIntegrate
instead of just summing up? $\endgroup$