changeset 12868:b00181c65533

maint: Periodic merge of stable to default
author Rik <octave@nomad.inbox5.com>
date Fri, 22 Jul 2011 13:15:00 -0700
parents fe6e2afcd9ee (current diff) a319f6835e9b (diff)
children de9a9719e594
files scripts/plot/surfc.m
diffstat 3 files changed, 35 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/surf.m	Fri Jul 22 13:05:26 2011 -0700
+++ b/scripts/plot/surf.m	Fri Jul 22 13:15:00 2011 -0700
@@ -60,3 +60,20 @@
   endif
 
 endfunction
+
+%!demo
+%! clf
+%! [~,~,Z]=peaks;
+%! surf(Z);
+
+%!demo
+%! [~,~,Z]=sombrero;
+%! [Fx,Fy] = gradient(Z);
+%! surf(Z,Fx+Fy);
+%! shading interp;
+
+%!demo
+%! [X,Y,Z]=sombrero;
+%! [~,Fy] = gradient(Z);
+%! surf(X,Y,Z,Fy);
+%! shading interp;
--- a/scripts/plot/surfc.m	Fri Jul 22 13:05:26 2011 -0700
+++ b/scripts/plot/surfc.m	Fri Jul 22 13:15:00 2011 -0700
@@ -73,3 +73,20 @@
   endif
 
 endfunction
+
+%!demo
+%! clf
+%! [~,~,Z]=peaks;
+%! surfc(Z);
+
+%!demo
+%! [~,~,Z]=sombrero;
+%! [Fx,Fy] = gradient(Z);
+%! surfc(Z,Fx+Fy);
+%! shading interp;
+
+%!demo
+%! [X,Y,Z]=sombrero;
+%! [~,Fy] = gradient(Z);
+%! surfc(X,Y,Z,Fy);
+%! shading interp;
--- a/scripts/strings/strtrim.m	Fri Jul 22 13:05:26 2011 -0700
+++ b/scripts/strings/strtrim.m	Fri Jul 22 13:15:00 2011 -0700
@@ -55,7 +55,7 @@
 
   elseif (iscell(s))
 
-    s = cellfun (@strtrim, s, "uniformoutput", false);
+    s = regexprep (s, '^\s+|\s+$', '');
 
   else
     error ("strtrim: expecting string argument");