source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/adjoint.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 433 bytes |
Line | |
---|---|
1 | function A = adjoint(X) |
2 | % ADJOINT Computes adjoint matrix |
3 | % |
4 | % A = ADJOINT(X) |
5 | % |
6 | % Brute-force implementation |
7 | |
8 | [n,m] = size(X); |
9 | if n~=m |
10 | error('Matrix must be square'); |
11 | end |
12 | |
13 | A = []; |
14 | if n == 1 |
15 | A = X; |
16 | return |
17 | end |
18 | |
19 | % Ugly brute-force |
20 | for i = 1:n |
21 | temp = []; |
22 | noti = setdiff(1:n,i); |
23 | for j = 1:n |
24 | notj = setdiff(1:n,j); |
25 | temp = [temp det(X(noti,notj))*((-1)^(i+j))]; |
26 | end |
27 | A = [A;temp]; |
28 | end |
29 | A = A'; |
30 |
Note: See TracBrowser
for help on using the repository browser.