Skip to content

Instantly share code, notes, and snippets.

@kenkangxgwe
Created February 5, 2017 02:52
Show Gist options
  • Save kenkangxgwe/1b483465a1fffd0cf2d725a008b5cdcb to your computer and use it in GitHub Desktop.
Save kenkangxgwe/1b483465a1fffd0cf2d725a008b5cdcb to your computer and use it in GitHub Desktop.
Interpolation and its plot for a X-Y 2D array
(* ::Package:: *)
Targetdir1 = "%Yourdir%\\*.txt"
(*For the table having two demensions.*)
Data=Import[Targetdir1,"Table"];
Curve=Interpolation[Data,Method->"Spline"(*,Method\[Rule]"Hermite"*)];
Show[ListPlot[Data,AxesLabel->{"x","y"}],Plot[Curve[x],{x,First[First[Data]],First[Last[Data]]}]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment