changeset 26562:8bed6950ddde

light.m: Change %!demo code #5 to produce comparable results under Matlab (bug #55841). * light.m: Use linspace rather than range operator to create a range for meshgrid with one more data point (12 vs. 11) which produces better visuals.
author Rik <rik@octave.org>
date Wed, 16 Jan 2019 11:56:09 -0800
parents a595c22464e4
children 73654374b86f
files scripts/plot/draw/light.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/light.m	Wed Jan 16 14:25:59 2019 -0500
+++ b/scripts/plot/draw/light.m	Wed Jan 16 11:56:09 2019 -0800
@@ -198,7 +198,8 @@
 %! ## Diffuse and specular reflection
 %! clf;
 %! h_axes = axes ();
-%! [x,y,z] = meshgrid (-.2:0.04:.2, -.2:0.04:.2, -.2:0.04:.2);
+%! rng = linspace (-0.2, +0.2, 12);
+%! [x,y,z] = meshgrid (rng);
 %! val = (x.^2 + y.^2 + z.^2);
 %!
 %! fv = isosurface (x, y, z, val, .039);