# How to calculate the mean of a set of a plotted points? [closed]

I am interested to calculate the mean of a certain set of points of a graphed curve. Any advice is really appreciated.

• Could you give a (minimal) example?
– eldo
Commented Jul 7, 2017 at 10:59
• Have you tried using Mean? You should provide a minimal working example of what you are trying to accomplish, otherwise you will hardly get any answer
– glS
Commented Jul 7, 2017 at 11:04
• I have a graph with a set of coordinates (points) that show a certain curvature (e.g. maximum). I want to specify these points in the "mean" in order to calculate the mean of these points.
– sam
Commented Jul 7, 2017 at 11:04
• What is the input (a plot?) and expected output? Where are you stuck because I'm assuming you are familiar with Mean.
– Kuba
Commented Jul 7, 2017 at 11:44
• Este não volta mais... Há uma semana não voltou pra ver a resposta Commented Jul 15, 2017 at 4:18

Here a example:

res[x_] := x^2 + 5
x = Range[-1, 10]
Mean[res[#] & /@ x] // N
points = Transpose[{x, res[x]}];
Plot[res[x], {x, -1, 10},
Epilog -> {Red, PointSize[0.02], Point[points]}]


{-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

37.1667

• Actually, I don't have a certain function. However, the points are given in a .txt file. How can we include a certain condition (e.g. if condition) to calculate the mean of a certain interval inside a column from the text file?
– sam
Commented Jul 7, 2017 at 13:10
• See this: Page1 Commented Jul 7, 2017 at 13:12
• Other: Page2 Commented Jul 7, 2017 at 13:13