# HG changeset patch # User Thomas D. Dean # Date 1233859349 18000 # Node ID 6d15bc6c4c15f813cae0650d14750ebedc1d99f8 # Parent e4f89f4a7cf88d50fcb32635404c11e56e35a30d polyout.m: Replace com2str with num2str. diff -r e4f89f4a7cf8 -r 6d15bc6c4c15 scripts/ChangeLog --- a/scripts/ChangeLog Thu Feb 05 13:09:22 2009 -0500 +++ b/scripts/ChangeLog Thu Feb 05 13:42:29 2009 -0500 @@ -1,3 +1,8 @@ +2009-02-05 Thomas D. Dean + + * polynomial/polyout.m: Replace com2str with num2str, and minor + style changes. + 2009-02-04 John W. Eaton * help/which.m: Still print something sensible if type is empty. diff -r e4f89f4a7cf8 -r 6d15bc6c4c15 scripts/polynomial/polyout.m --- a/scripts/polynomial/polyout.m Thu Feb 05 13:09:22 2009 -0500 +++ b/scripts/polynomial/polyout.m Thu Feb 05 13:42:29 2009 -0500 @@ -53,15 +53,14 @@ if (nargin == 1) x = "s"; - elseif (! ischar(x)) + elseif (! ischar (x)) error("polyout: second argument must be a string"); endif - n = length(c); + n = length (c); if(n > 0) n1 = n+1; - tmp = coeff (c(1)); for ii = 2:n if (real (c(ii)) < 0) @@ -79,21 +78,21 @@ endif if(nargout == 0) - disp(tmp) + disp (tmp) else y = tmp; endif endfunction -function str = coeff(c) +function str = coeff (c) if (imag (c)) if (real (c)) - str = sprintf ("(%s)", com2str(c)); + str = sprintf ("(%s)", num2str (c, 5)); else - str = com2str(c); + str = num2str (c, 5); endif else - str = num2str(c); + str = num2str (c, 5); endif - +endfunction