Mercurial > hg > ishara
annotate general/numerical/matrix/orthogonalise.m @ 29:61921dceded1
More documentation on type system.
author | samer |
---|---|
date | Sat, 19 Jan 2013 17:56:21 +0000 |
parents | db7f4afd27c5 |
children |
rev | line source |
---|---|
samer@4 | 1 function B1=orthogonalise(B), |
samer@4 | 2 % orthogonalise - Orthogonalise a basis matrix |
samer@4 | 3 % |
samer@4 | 4 % orthogonalise :: [[N,M]] -> [[N,M]]. |
samer@4 | 5 % |
samer@4 | 6 % Works using SVD. |
samer@4 | 7 |
samer@4 | 8 [U,S,V] = svd(B,0); |
samer@4 | 9 B1 = U*V'; |
samer@4 | 10 |
samer@4 | 11 % alternative method, seems to be slower |
samer@4 | 12 % B1 = B*real((B'*B)^(-0.5)); |
samer@4 | 13 |