From: <car...@us...> - 2012-04-17 09:20:39
|
Revision: 10255 http://octave.svn.sourceforge.net/octave/?rev=10255&view=rev Author: carandraug Date: 2012-04-17 09:20:28 +0000 (Tue, 17 Apr 2012) Log Message: ----------- plot: replace calls to usage() by print_usage() (usage is redundant and going to be deprecated in 3.8) and use of default arguments for simpler input check. Modified Paths: -------------- trunk/octave-forge/main/plot/inst/dxfwrite.m trunk/octave-forge/main/plot/inst/plotdecimate.m Modified: trunk/octave-forge/main/plot/inst/dxfwrite.m =================================================================== --- trunk/octave-forge/main/plot/inst/dxfwrite.m 2012-04-17 09:17:16 UTC (rev 10254) +++ trunk/octave-forge/main/plot/inst/dxfwrite.m 2012-04-17 09:20:28 UTC (rev 10255) @@ -34,8 +34,7 @@ ## Check arguments nb = 0; if nargin <= 1 - usage("dxfwrite = (filename, pl, ...)"); - return; + print_usage; endif ## Open file Modified: trunk/octave-forge/main/plot/inst/plotdecimate.m =================================================================== --- trunk/octave-forge/main/plot/inst/plotdecimate.m 2012-04-17 09:17:16 UTC (rev 10254) +++ trunk/octave-forge/main/plot/inst/plotdecimate.m 2012-04-17 09:20:28 UTC (rev 10255) @@ -31,17 +31,11 @@ ## plots, set @var{so} to @var{false}. ## @end deftypefn -function C = plotdecimate (P, so, res) +function C = plotdecimate (P, so = true, res = 1e-3) if (!ismatrix(P) || columns(P) != 2) error("P must be a matrix with two columns"); endif - if (nargin < 2) - so = true; # do segment optimisation - endif - if (nargin < 3) - res = 1e-3; # default resolution is 1000 dots/axis - endif ## Slack: admissible error on coordinates on the output plot if (isscalar(res)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |