]> Creatis software - CreaPhase.git/blobdiff - octave_packages/splines-1.0.7/fnval.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / splines-1.0.7 / fnval.m
diff --git a/octave_packages/splines-1.0.7/fnval.m b/octave_packages/splines-1.0.7/fnval.m
new file mode 100644 (file)
index 0000000..4dc9887
--- /dev/null
@@ -0,0 +1,14 @@
+## r = fnval(pp,x) or r = fnval(x,pp)
+## Compute the value of the piece-wise polynomial pp at points x.
+
+## This program is public domain.
+## Paul Kienzle, 2004-02-22
+function r = fnval(a,b,left)
+  if nargin == 2 || (nargin == 3 && left == 'l' && left == 'r')
+    # XXX FIXME XXX ignoring left continuous vs. right continuous option
+    if isstruct(a), r=ppval(a,b); else r=ppval(b,a); end
+  else
+    usage("r=fnval(pp,x) || r=fnval(x,pp)");
+  end
+end
+