Prev: List Manipulation: Conditionally changing y value when x value
Next: Washington DC Area Mathematica Special Interest Group
From: michuco on 12 Apr 2010 22:59 Hi all, I am trying to fit a series of 3D points, say data = {{{0, 0}, 0}, {{1, 1}, 1}, {{2, 2}, 2}}; with f = Interpolation[data] which gives me the error Interpolation::indim: The coordinates do not lie on a structured \ tensor product grid. I think that I got the data format wrong, but I can't tell from the Help library of Mathematica 6. Ideas? Thanks in advance, Michuco
From: Bill Rowe on 13 Apr 2010 22:39 On 4/12/10 at 11:01 PM, ibmichuco(a)hotmail.com (michuco) wrote: >Hi all, >I am trying to fit a series of 3D points, say >data = {{{0, 0}, 0}, {{1, 1}, 1}, {{2, 2}, 2}}; >with >f = Interpolation[data] >which gives me the error >Interpolation::indim: The coordinates do not lie on a structured \ >tensor product grid. >I think that I got the data format wrong, but I can't tell from the >Help library of Mathematica 6. >Ideas? Thanks in advance, The following which has the same structure but more points works: In[17]:= data = Flatten[Table[{{x, y}, LCM[x, y]}, {x, 4}, {y, 4}], 1]; f = Interpolation[data] Out[18]= InterpolatingFunction[{{1,4},{1,4}},<>] By default Interpolation does a cubic interpolation. Three data points simply isn't enough to uniquely define the parameters of a cubic curve.
From: Frank Iannarilli on 14 Apr 2010 05:15 On Apr 12, 10:59 pm, michuco <ibmich...(a)hotmail.com> wrote: > Hi all, > > I am trying to fit a series of 3D points, say > > data = {{{0, 0}, 0}, {{1, 1}, 1}, {{2, 2}, 2}}; > > with > > f = Interpolation[data] > > which gives me the error > > Interpolation::indim: The coordinates do not lie on a structured \ > tensor product grid. > > I think that I got the data format wrong, but I can't tell from the > Help library of Mathematica 6. > > Ideas? Thanks in advance, > > Michuco See: http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/db13c11591442ba3/ed81b03fe82e1729?lnk=gst&q=triangularinterpolate#ed81b03fe82e1729 for TriangularInterpolateNative package.
From: Hans Michel on 14 Apr 2010 05:15
Try data = {{{0, 0}, 0}, {{1, 1}, 1}, {{2, 2}, 2}}; f = ListInterpolation[data[[All, 1]], InterpolationOrder -> 1] You may need use Sort or SortBy on data if column 2 is not well ordered Because your sample does not have enough points without InterpolationOrder ->1 you would order too high warning. See: ref/message/ListInterpolation/inhr Hans "michuco" <ibmichuco(a)hotmail.com> wrote in message news:hq0mlv$jsb$1(a)smc.vnet.net... > Hi all, > > I am trying to fit a series of 3D points, say > > data = {{{0, 0}, 0}, {{1, 1}, 1}, {{2, 2}, 2}}; > > with > > f = Interpolation[data] > > which gives me the error > > Interpolation::indim: The coordinates do not lie on a structured \ > tensor product grid. > > I think that I got the data format wrong, but I can't tell from the > Help library of Mathematica 6. > > Ideas? Thanks in advance, > > Michuco > |