diff scripts/plot/sombrero.m @ 6049:04c2ad6d1679

[project @ 2006-10-13 14:32:15 by jwe]
author jwe
date Fri, 13 Oct 2006 14:32:23 +0000
parents 34f96dd5441b
children b15a143c5607
line wrap: on
line diff
--- a/scripts/plot/sombrero.m
+++ b/scripts/plot/sombrero.m
@@ -30,7 +30,7 @@
 
 ## Author: jwe
 
-function sombrero (n)
+function [x, y, z] = sombrero (n)
 
   if (nargin == 0)
     n = 41;
@@ -42,7 +42,9 @@
       [xx, yy] = meshgrid (x, y);
       r = sqrt (xx .^ 2 + yy .^ 2) + eps;
       z = sin (r) ./ r;
-      mesh (x, y, z);
+      if (nargout == 0)
+        mesh (x, y, z);
+      end
     else
       error ("sombrero: number of grid lines must be greater than 1");
     endif