Mercurial > hg > octave-terminal
changeset 12812:4c93cc41da15 stable
codesprint: add demo for surf.m and surfc.m
author | Kai Habel <kai.habel@gmx.de> |
---|---|
date | Sat, 16 Jul 2011 20:56:20 +0200 |
parents | 4e70c4e61c24 |
children | a319f6835e9b |
files | scripts/plot/surf.m scripts/plot/surfc.m |
diffstat | 2 files changed, 34 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- a/scripts/plot/surfc.m +++ b/scripts/plot/surfc.m @@ -54,3 +54,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;