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

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

Added original make3d

File size: 874 bytes
Line 
1function t = sum(a, dim)
2% SUM Sum of elements.
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(1, 2, nargin)), error(nargoutchk(0, 1, nargout))
9
10if nargin == 1
11    if ispure(a)
12        t = quaternion(sum(x(a)), ...
13                       sum(y(a)),....
14                       sum(z(a)));
15    else
16        t = quaternion(sum(s(a)), sum(v(a)));
17    end
18else
19    if dim == 'double' | dim == 'native'
20        error('Parameters ''double'' or ''native'' are not implemented.');
21    else
22        if ispure(a)
23            t = quaternion(sum(x(a), dim), ...
24                           sum(y(a), dim), ...
25                           sum(z(a), dim));
26        else
27            t = quaternion(sum(s(a), dim), sum(v(a), dim));
28        end
29    end
30end
Note: See TracBrowser for help on using the repository browser.