Mercurial > hg > octave-terminal
changeset 12253:1f14586af94c release-3-4-x
curl: simplify processing of output values
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Jan 2011 23:15:59 -0500 |
parents | 6a82092ffaea |
children | 23385f2c90b7 |
files | scripts/ChangeLog scripts/general/curl.m |
diffstat | 2 files changed, 7 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2011-01-26 John W. Eaton <jwe@octave.org> + + * general/curl.m: Simplify processing of outptut values. + 2011-01-26 Olaf Till <olaf.till@uni-jena.de> * pkg/pkg.m: Export environment variables MKOCTFILE and
--- a/scripts/general/curl.m +++ b/scripts/general/curl.m @@ -88,9 +88,7 @@ dFy_dx = gradient (varargin{fidx + 1}, dx, dy); rot_z = dFy_dx - dFx_dy; av = rot_z / 2; - if (nargout == 0) - av - elseif (nargout == 1) + if (nargout == 0 || nargout == 1) varargout{1} = av; elseif (nargout == 2) varargout{1} = rot_z; @@ -121,18 +119,9 @@ rot_y .* varargin{fidx + 1} + rot_z .* varargin{fidx + 2}) ./ (2 * l); - if (nargout == 0) - varargout{1} = av; - elseif (nargout == 1) + if (nargout == 0 || nargout == 1) varargout{1} = av; - elseif (nargout == 2) - varargout{1} = rot_x; - varargout{2} = rot_y; - elseif (nargout == 3) - varargout{1} = rot_x; - varargout{2} = rot_y; - varargout{3} = rot_z; - elseif (nargout == 4) + else varargout{1} = rot_x; varargout{2} = rot_y; varargout{3} = rot_z;