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

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

Added original make3d

File size: 733 bytes
Line 
1function m = mean(X, dim)
2% MEAN   Average or mean value.
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(X)
12        m = quaternion(mean(x(X)), ...
13                       mean(y(X)), ...
14                       mean(z(X)));
15    else
16        m = quaternion(mean(s(X)), mean(v(X)));
17    end
18else
19    if ispure(X)
20        m = quaternion(mean(x(X), dim), ...
21                       mean(y(X), dim), ...
22                       mean(z(X), dim));
23    else
24        m = quaternion(mean(s(X), dim), mean(v(X), dim));
25    end
26end
Note: See TracBrowser for help on using the repository browser.