Extract points from an interpolated curve (not a function)

  • Mathematica
  • Thread starter joshmccraney
  • Start date
  • #1
joshmccraney
Gold Member
1,964
104
Hi PF!

I have the given data points here
Code:
data = 
{{1.92, 0.74}, {2.32, 1.36}, {2.44, 1.88}, {2.52, 2.08}, {2.68, 
  1.92}, {2.64, 1.4}, {2.46, 0.78}};
and the following plots the correct interpolation

Code:
Show[{ListLinePlot[{data}, InterpolationOrder -> 3], 
  ListPlot[\[Lambda]cplx1]}]
Screen Shot 2021-01-13 at 2.25.10 PM.png

but I don't know how to extract points along this curve. If I try this

Code:
f = Interpolation[data];
Plot[f[x], {x, 1.92, 2.6}]
the plot is terrible:
Screen Shot 2021-01-13 at 2.25.18 PM.png


Any ideas how to extract several points from the correct function?
 

Answers and Replies

  • #2
Dale
Mentor
Insights Author
2020 Award
30,649
7,209
It looks like the data points represent a curve in a 2D space parameterized by a single unspecified parameter. So the points are {x[t],y[t]} with t unspecified.

Then your interpolation is y[x].
 
  • Like
Likes joshmccraney
  • #3
joshmccraney
Gold Member
1,964
104
Just thought this exact point! Got it working now, thanks Dale!
 
  • Like
Likes Dale
  • #5
joshmccraney
Gold Member
1,964
104
What is your new code?
My ultimate goal was to import into MATLAB. I was having difficulties with the interpolation, but realized (as you pointed out) that the plots didn't know which order to interpolate, and that including the third coordinate does so nicely. So I did not use Mathematica for plotting, but exported the points into MATLAB. Thanks so much for your help!
 

Related Threads on Extract points from an interpolated curve (not a function)

Replies
2
Views
960
Replies
4
Views
2K
Replies
3
Views
4K
  • Last Post
Replies
9
Views
2K
Replies
1
Views
5K
Top