0
$\begingroup$

I have a list of data. I integrate them with interpolation. Lets say is the following:

  InterpolatingFunction[{{0.01, 4.82}}, <>][x]

However, is that anyway for me to get an array of coordinates of the function after integration?

Thank you

$\endgroup$
1
2
$\begingroup$

I am not quite sure what you want but this may help. First I generate some data

data = Table[{x, x + Sin[2 \[Pi] x]}, {x, 0.01, 4.82, 0.1}];

This plots as

ListPlot[data, Frame -> True, PlotTheme -> "Scientific"]

Mathematica graphics

Now we make an interpolation function and then integrate

f = Interpolation[data];
g = Integrate[f[x], x]

Interestingly the x from the integration gets built in to the new fuction. Someone might like to explain this

Mathematica graphics

I remove the [x] at the end by taking the head

g1 = Head[g];

Now we can plot the integrated function

p1 = Plot[g1[x], {x, 0.01, 4.82}, Frame -> True, 
  PlotTheme -> "Scientific"]

Mathematica graphics

If we want to go back to coordinates then there are several ways. If we wish to use the same x values as before then can do the following

cc = Transpose[{data[[All, 1]], g1[#] & /@ data[[All, 1]]}];

and plot

Show[p1, ListPlot[cc, PlotStyle -> {Green}]]

Mathematica graphics

Is this what you are after?

$\endgroup$
2
  • $\begingroup$ Yes! thank you very much!!!:) $\endgroup$ – Yincheng Liu Nov 8 '15 at 1:15
  • $\begingroup$ @YinchengLiu I am glad I could help. The usual procedure is for you to accept the answer by applying the tick and thus closing the discussion. $\endgroup$ – Hugh Nov 8 '15 at 7:31

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