1
$\begingroup$

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

$\endgroup$
5
  • 1
    $\begingroup$ Could you give a (minimal) example? $\endgroup$
    – eldo
    Commented Jul 7, 2017 at 10:59
  • 1
    $\begingroup$ 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 $\endgroup$
    – glS
    Commented Jul 7, 2017 at 11:04
  • $\begingroup$ 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. $\endgroup$
    – sam
    Commented Jul 7, 2017 at 11:04
  • $\begingroup$ What is the input (a plot?) and expected output? Where are you stuck because I'm assuming you are familiar with Mean. $\endgroup$
    – Kuba
    Commented Jul 7, 2017 at 11:44
  • $\begingroup$ Este não volta mais... Há uma semana não voltou pra ver a resposta $\endgroup$
    – Luciano
    Commented Jul 15, 2017 at 4:18

1 Answer 1

2
$\begingroup$

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

enter image description here

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – sam
    Commented Jul 7, 2017 at 13:10
  • $\begingroup$ See this: Page1 $\endgroup$
    – LCarvalho
    Commented Jul 7, 2017 at 13:12
  • $\begingroup$ Other: Page2 $\endgroup$
    – LCarvalho
    Commented Jul 7, 2017 at 13:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.