Extract points from an interpolated curve (not a function)

  • Mathematica
  • Thread starter joshmccraney
  • Start date
  • #1
joshmccraney
Gold Member
2,253
143
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
33,866
11,572
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
2,253
143
Just thought this exact point! Got it working now, thanks Dale!
 
  • #5
joshmccraney
Gold Member
2,253
143
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!
 

Suggested for: Extract points from an interpolated curve (not a function)

  • Last Post
Replies
1
Views
470
Replies
8
Views
877
  • Last Post
Replies
2
Views
2K
Replies
0
Views
398
  • Last Post
Replies
1
Views
562
  • Last Post
Replies
9
Views
4K
  • Last Post
Replies
2
Views
529
  • Last Post
Replies
1
Views
1K
Replies
10
Views
2K
Replies
10
Views
818
Top