# HG changeset patch # User Rik # Date 1311365700 25200 # Node ID b00181c65533f00943c22fc1408f41feb2808d0d # Parent fe6e2afcd9ee93c44237e0658fe717e98a15e878# Parent a319f6835e9bc3028e0783a1cd7469b976bce77e maint: Periodic merge of stable to default diff --git a/scripts/plot/surf.m b/scripts/plot/surf.m --- a/scripts/plot/surf.m +++ b/scripts/plot/surf.m @@ -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; diff --git a/scripts/plot/surfc.m b/scripts/plot/surfc.m --- a/scripts/plot/surfc.m +++ b/scripts/plot/surfc.m @@ -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; diff --git a/scripts/strings/strtrim.m b/scripts/strings/strtrim.m --- a/scripts/strings/strtrim.m +++ b/scripts/strings/strtrim.m @@ -55,7 +55,7 @@ elseif (iscell(s)) - s = cellfun (@strtrim, s, "uniformoutput", false); + s = regexprep (s, '^\s+|\s+$', ''); else error ("strtrim: expecting string argument");