Mercurial > matrix-functions
comparison toolbox/tmtdemo.m @ 7:e0817ccb2834 draft
Add square root matrix function file, rename atom at funm_files, modify old toolbox to run it inside GNU Octave.
added funm_files/fun_atom.m
added sqrtm2.m
added toolbox/gecp.m
toolbox/see.m: comment wrong call to subplot
toolbox/tmtdemo.m: add a cast to double, as eig does not admit bool matrix input
removed funm_files/funm_atom.m
author | Antonio Pino Robles <data.script93@gmail.com> |
---|---|
date | Tue, 26 May 2015 18:14:54 +0200 |
parents | 8f23314345f4 |
children |
comparison
equal
deleted
inserted
replaced
6:adcd5fc9b9a2 | 7:e0817ccb2834 |
---|---|
215 % matrix in turn. It evaluate the 2-norm condition number and the | 215 % matrix in turn. It evaluate the 2-norm condition number and the |
216 % ratio of the largest to smallest eigenvalue (in absolute values). | 216 % ratio of the largest to smallest eigenvalue (in absolute values). |
217 c = []; e = []; j = 1; | 217 c = []; e = []; j = 1; |
218 for i=1:matrix(0) | 218 for i=1:matrix(0) |
219 A = full(matrix(i, 10)); | 219 A = full(matrix(i, 10)); |
220 if norm(skewpart(A),1) % If not Hermitian... | 220 if norm(skewpart(A),1) |
221 c1 = cond(A); | 221 c1 = cond(A); |
222 eg = eig(A); | 222 eg = eig(double(A)); |
223 e1 = max(abs(eg)) / min(abs(eg)); | 223 e1 = max(abs(eg)) / min(abs(eg)); |
224 % Filter out extremely ill-conditioned matrices. | 224 % Filter out extremely ill-conditioned matrices. |
225 if c1 <= 1e10, c(j) = c1; e(j) = e1; j = j + 1; end | 225 if c1 <= 1e10, c(j) = c1; e(j) = e1; j = j + 1; end |
226 end | 226 end |
227 end | 227 end |