Rev | Line | |
---|
[37] | 1 | function disp(q) |
---|
| 2 | % DISP Display array. |
---|
| 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 | |
---|
| 8 | error(nargchk(1, 1, nargin)), error(nargoutchk(0, 0, nargout)) |
---|
| 9 | |
---|
| 10 | % The argument is not checked, since this function is called by Matlab only if |
---|
| 11 | % the argument is a quaternion. There are three cases to be handled: empty, a |
---|
| 12 | % pure quaternion, a full quaternion. In the latter two cases, the fields may |
---|
| 13 | % be arrays. |
---|
| 14 | |
---|
| 15 | [r,c] = size(q); |
---|
| 16 | if isempty(q) |
---|
| 17 | disp(' []') |
---|
| 18 | elseif r == 1 & c == 1 |
---|
| 19 | disp([' ' char(q)]) |
---|
| 20 | elseif ispure(q) |
---|
| 21 | disp([' ' num2str(r) 'x' num2str(c) ' pure quaternion array']) |
---|
| 22 | else |
---|
| 23 | disp([' ' num2str(r) 'x' num2str(c) ' quaternion array']) |
---|
| 24 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.