octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55481] Plotting differences from Matlab at 5.


From: Rik
Subject: [Octave-bug-tracker] [bug #55481] Plotting differences from Matlab at 5.0 release
Date: Wed, 16 Jan 2019 14:58:58 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #21, bug #55481 (project octave):

@Markus: If the results are do approximations then using a finer grid should
help.  I changed light demo #5 from


 [x,y,z] = meshgrid (-.2:0.04:.2, -.2:0.04:.2, -.2:0.04:.2);
 val = (x.^2 + y.^2 + z.^2);


to


 [x,y,z] = meshgrid (-.2:0.01:.2, -.2:0.01:.2, -.2:0.01:.2);
 val = (x.^2 + y.^2 + z.^2);


This changes the number of points in val from 1331 to 68921.  When I run the
light demo on Matlab and Octave they now appear the same.  So, that seems to
be the way forward.

For demo #5 I checked in a changeset
(https://hg.savannah.gnu.org/hgweb/octave/rev/8bed6950ddde) where instead of
the range operator I use linspace and I increased the number of points from 11
to 12.  This produces results which match those of Matlab.


rng = linspace (-0.2, +0.2, 12);
[x,y,z] = meshgrid (rng);


It might be useful to replace the range operator in other demo blocks of light
as well, but #5 was the most glaring to me.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55481>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]