Line | |
---|
1 | % Test code for the quaternion eigenvalue decomposition. |
---|
2 | |
---|
3 | % Copyright © 2006 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
4 | % See the file : Copyright.m for further details. |
---|
5 | |
---|
6 | T = 1e-12; |
---|
7 | |
---|
8 | A = quaternion(randn(10,10),randn(10,10),randn(10,10),randn(10,10)); |
---|
9 | A = A * A'; % The matrix must be Hermitian. |
---|
10 | |
---|
11 | [V, D] = eig(A); |
---|
12 | compare(A * V , V * D, T, 'quaternion/eig failed test 1A') |
---|
13 | |
---|
14 | D = eig(A); |
---|
15 | compare(A * V, ... |
---|
16 | V * diag(D), T, 'quaternion/eig failed test 1B') |
---|
17 | |
---|
18 | clear A V D |
---|
Note: See
TracBrowser
for help on using the repository browser.