I am interested to calculate the mean of a certain set of points of a graphed curve. Any advice is really appreciated.
Asked
Active
Viewed 93 times
1 Answers
2
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
LCarvalho
- 9,233
- 4
- 40
- 96
-
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 Jul 07 '17 at 13:10 -
-

Mean? You should provide a minimal working example of what you are trying to accomplish, otherwise you will hardly get any answer – glS Jul 07 '17 at 11:04Mean. – Kuba Jul 07 '17 at 11:44