comparison scripts/plot/sombrero.m @ 904:3470f1e25a79

[project @ 1994-11-09 21:22:15 by jwe]
author jwe
date Wed, 09 Nov 1994 21:22:15 +0000
parents 16a24e76d6e0
children 3f257ab07921
comparison
equal deleted inserted replaced
903:b3692d63cca3 904:3470f1e25a79
1 # Copyright (C) 1993 John W. Eaton 1 # Copyright (C) 1993, 1994 John W. Eaton
2 # 2 #
3 # This file is part of Octave. 3 # This file is part of Octave.
4 # 4 #
5 # Octave is free software; you can redistribute it and/or modify it 5 # Octave is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the 6 # under the terms of the GNU General Public License as published by the
24 # function plotted is 24 # function plotted is
25 # 25 #
26 # z = sin (x^2 + y^2) / (x^2 + y^2); 26 # z = sin (x^2 + y^2) / (x^2 + y^2);
27 27
28 if (nargin != 1) 28 if (nargin != 1)
29 error ("usage: sombrero (n)"); 29 usage ("sombrero (n)");
30 endif 30 endif
31 31
32 x = y = linspace (-8, 8, n)'; 32 x = y = linspace (-8, 8, n)';
33 [xx, yy] = meshdom (x, y); 33 [xx, yy] = meshdom (x, y);
34 r = sqrt (xx .^ 2 + yy .^ 2) + eps; 34 r = sqrt (xx .^ 2 + yy .^ 2) + eps;