From bug-octave-request at bevo dot che dot wisc dot edu Tue Dec 30 22:19:27 2003 Subject: Bug: Three point fit leads to csape problem From: Joe Koski To: Date: Mon, 29 Dec 2003 11:13:47 -0600 In substituting the octave-forge spline.m for the Matlab interp1 routine, I discovered that, while interp1 apparently returns a fit, csape.m crashes when presented with three points in the spline fit. Example: octave:1> x=rand(1:3) x = 0.45231 0.39556 0.48169 octave:2> y=rand(1:3) y = 0.73379 0.42766 0.69522 octave:3> pp=spline(x,y) error: `ldg' undefined near line 169 column 29 error: evaluating argument list element number 1 error: evaluating assignment expression near line 169, column 18 error: evaluating if command near line 59, column 3 error: called from `csape' in file `/sw/share/octave/2.1.46/site/m/octave-forge/splines/csape.m' error: evaluating assignment expression near line 33, column 7 error: called from `spline' in file `/sw/share/octave/2.1.46/site/m/octave-forge/splines/spline.m' error: evaluating assignment expression near line 3, column 3 octave:3> When given four points, spline returns a value. For three points, shouldn't spline/csape return either an error message or a value for pp? Apparently interp1 does return pp for three points. Joe Koski ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------