Rev | Line | |
---|
[37] | 1 | function b = repmat(a, m, n) |
---|
| 2 | % REPMAT Replicate and tile an 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(2, 3, nargin)), error(nargoutchk(0, 1, nargout)) |
---|
| 9 | |
---|
| 10 | if nargin == 2 |
---|
| 11 | if ispure(a) |
---|
| 12 | b = quaternion(repmat(x(a), m), ... |
---|
| 13 | repmat(y(a), m), ... |
---|
| 14 | repmat(z(a), m)); |
---|
| 15 | else |
---|
| 16 | b = quaternion(repmat(s(a), m), ... |
---|
| 17 | repmat(v(a), m)); |
---|
| 18 | end |
---|
| 19 | else |
---|
| 20 | if ispure(a) |
---|
| 21 | b = quaternion(repmat(x(a), m, n), ... |
---|
| 22 | repmat(y(a), m, n), ... |
---|
| 23 | repmat(z(a), m, n)); |
---|
| 24 | else |
---|
| 25 | b = quaternion(repmat(s(a), m, n), ... |
---|
| 26 | repmat(v(a), m, n)); |
---|
| 27 | end |
---|
| 28 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.