comparison +util/matrixborrow.m @ 0:48b6fb693025

Initial commit.
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 17 Sep 2015 10:12:50 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:48b6fb693025
1 function alpha = matrixborrow(A,B)
2
3 function y = neg(x)
4 y = min(eig(A-x*B));
5 end
6
7
8 x0 = 1;
9 while neg(x0) > -1
10 x0 = 2*x0;
11 end
12
13 opt = optimset('Display','none');
14 alpha = fsolve(@neg, x0,opt);
15 end