source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/qtfm/@quaternion/cat.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 828 bytes
Line 
1function r = cat(dim, varargin)
2% CAT Concatenate arrays.
3% (Quaternion overloading of standard Matlab function.)
4
5% Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan.
6% See the file : Copyright.m for further details.
7
8error(nargchk(3, inf, nargin)), error(nargoutchk(0, 1, nargout))
9
10a = varargin{1};
11b = varargin{2};
12
13if ispure(a) ~= ispure(b)
14    error('Cannot concatenate mixture of pure and full quaternion arrays');
15end
16
17if ispure(a)
18    r = quaternion(cat(dim, x(a), x(b)), ...
19                   cat(dim, y(a), y(b)), ...
20                   cat(dim, z(a), z(b)));
21else
22    r = quaternion(cat(dim, s(a), s(b)), ...
23                   cat(dim, x(a), x(b)), ...
24                   cat(dim, y(a), y(b)), ...
25                   cat(dim, z(a), z(b)));
26end
27
28if nargin > 3
29    r = cat(dim, r, varargin{3:end});   
30end
Note: See TracBrowser for help on using the repository browser.