Mercurial > hg > octave-lyh
comparison scripts/linear-algebra/cross.m @ 5775:ace8d8d26933
[project @ 2006-04-24 19:13:06 by jwe]
author | jwe |
---|---|
date | Mon, 24 Apr 2006 19:13:11 +0000 |
parents | ebe5d7d15522 |
children | 500d884ae373 |
comparison
equal
deleted
inserted
replaced
5774:e7af222e98b0 | 5775:ace8d8d26933 |
---|---|
44 if (nargin != 2 && nargin != 3) | 44 if (nargin != 2 && nargin != 3) |
45 usage ("cross (x, y, dim)"); | 45 usage ("cross (x, y, dim)"); |
46 endif | 46 endif |
47 | 47 |
48 if (ndims (x) < 3 && ndims (y) < 3 && nargin < 3) | 48 if (ndims (x) < 3 && ndims (y) < 3 && nargin < 3) |
49 ## XXX COMPATIBILITY XXX opposite behaviour for cross(row,col) | 49 ## COMPATIBILITY -- opposite behaviour for cross(row,col) |
50 ## Swap x and y in the assignments below to get the matlab behaviour. | 50 ## Swap x and y in the assignments below to get the matlab behaviour. |
51 ## Better yet, fix the calling code so that it uses conformant vectors. | 51 ## Better yet, fix the calling code so that it uses conformant vectors. |
52 if (columns (x) == 1 && rows (y) == 1) | 52 if (columns (x) == 1 && rows (y) == 1) |
53 warning ("cross: taking cross product of column by row"); | 53 warning ("cross: taking cross product of column by row"); |
54 y = y.'; | 54 y = y.'; |