Mercurial > hg > octave-nkf
comparison scripts/general/curl.m @ 20038:9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Try to trim long lines to < 80 chars.
Use '##' for single line comments.
Use '(...)' around tests for if/elseif/switch/while.
Abut cell indexing operator '{' next to variable.
Abut array indexing operator '(' next to variable.
Use space between negation operator '!' and following expression.
Use two newlines between endfunction and start of %!test or %!demo code.
Remove unnecessary parens grouping between short-circuit operators.
Remove stray extra spaces (typos) between variables and assignment operators.
Remove stray extra spaces from ends of lines.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 23 Feb 2015 14:54:39 -0800 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
20037:a1acca0c2216 | 20038:9fc020886ae9 |
---|---|
72 dz = varargin{3}(1,1,:)(:); | 72 dz = varargin{3}(1,1,:)(:); |
73 else | 73 else |
74 print_usage (); | 74 print_usage (); |
75 endif | 75 endif |
76 | 76 |
77 if ((nargin == 4) || (nargin == 2)) | 77 if (nargin == 4 || nargin == 2) |
78 if (!size_equal (varargin{fidx}, varargin{fidx + 1})) | 78 if (! size_equal (varargin{fidx}, varargin{fidx + 1})) |
79 error ("curl: size of X and Y must match"); | 79 error ("curl: size of X and Y must match"); |
80 elseif (ndims (varargin{fidx}) != 2) | 80 elseif (ndims (varargin{fidx}) != 2) |
81 error ("curl: expected two-dimensional matrices X and Y"); | 81 error ("curl: expected two-dimensional matrices X and Y"); |
82 elseif ((length (dx) != columns (varargin{fidx})) | 82 elseif ((length (dx) != columns (varargin{fidx})) |
83 || (length (dy) != rows (varargin{fidx}))) | 83 || (length (dy) != rows (varargin{fidx}))) |
93 else | 93 else |
94 varargout{1} = rot_z; | 94 varargout{1} = rot_z; |
95 varargout{2} = av; | 95 varargout{2} = av; |
96 endif | 96 endif |
97 | 97 |
98 elseif ((nargin == 6) || (nargin == 3)) | 98 elseif (nargin == 6 || nargin == 3) |
99 if (!size_equal (varargin{fidx}, varargin{fidx + 1}, varargin{fidx + 2})) | 99 if (! size_equal (varargin{fidx}, varargin{fidx + 1}, varargin{fidx + 2})) |
100 error ("curl: size of X, Y, and Z must match"); | 100 error ("curl: size of X, Y, and Z must match"); |
101 elseif (ndims (varargin{fidx}) != 3) | 101 elseif (ndims (varargin{fidx}) != 3) |
102 error ("curl: expected two-dimensional matrices X, Y, and Z"); | 102 error ("curl: expected two-dimensional matrices X, Y, and Z"); |
103 elseif ((length (dx) != size (varargin{fidx}, 2)) | 103 elseif ((length (dx) != size (varargin{fidx}, 2)) |
104 || (length (dy) != size (varargin{fidx}, 1)) | 104 || (length (dy) != size (varargin{fidx}, 1)) |