diff scripts/polynomial/spline.m @ 6014:437f9086b967

[project @ 2006-09-30 15:27:06 by jwe]
author jwe
date Sat, 30 Sep 2006 15:27:06 +0000
parents 376e02b2ce70
children 7fad1fad19e1
line wrap: on
line diff
--- a/scripts/polynomial/spline.m	Fri Sep 29 20:50:35 2006 +0000
+++ b/scripts/polynomial/spline.m	Sat Sep 30 15:27:06 2006 +0000
@@ -94,13 +94,13 @@
   szy = size (y);
   if (ndy == 2 && (szy(1) == 1 || szy(2) == 1))
     if (szy(1) == 1)
-      a = y';
+      a = y.';
     else
       a = y;
       szy = fliplr (szy);
     endif
   else
-    a = reshape (y, [prod(szy(1:end-1)), szy(end)])';
+    a = reshape (y, [prod(szy(1:end-1)), szy(end)]).';
   endif
   complete = false;
   if (size (a, 1) == n + 2)
@@ -227,3 +227,13 @@
 %!assert (isempty(spline(x',y',[])));
 %!assert (isempty(spline(x,y,[])));
 %!assert (spline(x,[y;y],x), [spline(x,y,x);spline(x,y,x)])
+%! y = cos(x) + i*sin(x);
+%!assert ( spline(x,y,x), y )
+%!assert ( real(spline(x,y,x)), real(y) );
+%!assert ( real(spline(x,y,x.')), real(y).' );
+%!assert ( real(spline(x.',y.',x.')), real(y).' );
+%!assert ( real(spline(x.',y,x)), real(y) );
+%!assert ( imag(spline(x,y,x)), imag(y) );
+%!assert ( imag(spline(x,y,x.')), imag(y).' );
+%!assert ( imag(spline(x.',y.',x.')), imag(y).' );
+%!assert ( imag(spline(x.',y,x)), imag(y) );