# HG changeset patch # User Rik # Date 1397012907 25200 # Node ID a07814a8ffb04e75cb18bfe49eff32e6742a55d0 # Parent 4792a115c7358d8f332ef591888daac2da5568b8 interp1.m: Small formatting changes only. * interp1.m: Keep line lengths < 80 characters. Use if/elseif to avoid one unnecessary calculation. diff -r 4792a115c735 -r a07814a8ffb0 scripts/general/interp1.m --- a/scripts/general/interp1.m Tue Apr 08 20:02:18 2014 -0700 +++ b/scripts/general/interp1.m Tue Apr 08 20:08:27 2014 -0700 @@ -195,10 +195,8 @@ else rightcontinuous = true; endif - endif - - if ((rightcontinuous && (x(end) < x(1))) - || (! rightcontinuous && (x(end) > x(1)))) + elseif ((rightcontinuous && (x(end) < x(1))) + || (! rightcontinuous && (x(end) > x(1)))) ## Switch between left-continuous and right-continuous x = flipud (x); y = flipud (y); @@ -217,7 +215,8 @@ warning ("interp1: multiple discontinuities at the same X value"); endif else - error ("interp1: discontinuities not supported for method '%s'", method); + error ("interp1: discontinuities not supported for method '%s'", + method); endif endif endif @@ -240,6 +239,7 @@ pp = mkpp ([x(1), x(1)+[0.5:(nx-1)]*dx, x(nx)], shiftdim (y, 1), szy(2:end)); pp.orient = "first"; + if (ispp) yi = pp; else