Mathematica Extract points from an interpolated curve (not a function)

AI Thread Summary
The discussion revolves around the challenge of extracting points from a set of data points in a 2D space for interpolation. The user initially struggles with plotting the interpolation correctly using Mathematica, as the plot does not represent the data accurately. After realizing the need to specify the interpolation order and including a third coordinate, they successfully generate the desired curve. The user ultimately aims to import the interpolated data into MATLAB for further analysis, indicating that the assistance received helped clarify the interpolation process.
member 428835
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?
 
Physics news on Phys.org
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 member 428835
Just thought this exact point! Got it working now, thanks Dale!
 
  • Like
Likes Dale
joshmccraney said:
Just thought this exact point! Got it working now, thanks Dale!
What is your new code?
 
Dale said:
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!
 
Back
Top