I'm pretty new to Mathematica (as in been playing with it for about a day), and would like to get an average of some currents (the y-co-ordinate in the data that follows), with respect to time (the x-co-ordinate). However the data was taken at irregular time intervals. I resolved that i was probably best to go about this, by plotting the data, interpolating, Numerically integrating (I assume mathematica basically just uses the trapezium rule for this) and then dividing by the number of points provided by the interpolating (the number of trapeziums). I'm happy to revise this method, that's just where I'm up to so far.
I've managed to use ListLinePlot with InterpolatingOrder->3 to plot my data and interpolate, but can't figure out how integrate the data sets to get the average current.
dataNi58 = {{60, 17.5}, {229, 53.5}, {516, 52.8}, {767, 40.8}}
dataMo72 = {{83, 4.5}, {128, 12.8}, {161, 18.0}, {290, 22.0}, {349,
22.6}, {382, 24.0}, {475, 25.0}, {520, 25.8}, {541, 26.1}, {613,
26.0}, {650, 25.8}, {671, 25.7}, {726, 25.8}, {830, 22.7}, {848,
23.3}, {955, 23.2}, {1071, 23.5}, {1171, 24.3}, {1219,
23.8}, {1321, 24.2}, {1386, 24.3}}
ListLinePlot[{dataNi58, dataMo72}, PlotTheme -> "Detailed",
PlotRange -> {{0, 1400}, {0, 60}},
PlotLabel ->
HoldForm["Comparison of Current Yields from a Nickel and a \
Molybdenum Cathode (Interpolated)"],
PlotLegends -> {"Cathode 58 - Nickel" , "Cathode 72 - Molybdenum"},
PlotMarkers -> Automatic, PlotStyle -> 96, Axes -> True,
Frame -> {{True, False}, {True, False}},
FrameLabel -> {HoldForm["Current (\[Mu]A)"],
HoldForm["Cathode Runtime (minutes)" ]},
LabelStyle -> {GrayLevel[0], Bold}, ImageSize -> {850, 550},
InterpolationOrder -> 3]
Thanks for any help.
average[lst_] := Mean[Transpose[lst][[2]]]
and then apply it to your lists. For exampleaverage[dataNi58]
yields 41.2. Have fun! $\endgroup$