http://sites.google.com/feeds/content/site/occasionalnotes2019-08-22T22:31:36.449ZPosts of Positive/negative definite matrixGoogle Sites1http://sites.google.com/feeds/content/site/occasionalnotes/91616780778499563042015-09-28T17:04:20.864Z2015-09-28T17:04:20.867Z2015-09-28T17:04:20.860ZHow to identify a matrix is Positive Definite
 Matlab Code: http://www.mathworks.com/matlabcentral/answers/101132#answer_140036`A = [1,0;0,2]; % Example matrix``eig_A = eig(A);``flag = 0;``for i = 1:rank(A)` `if eig_A(i) <= 0 ` `flag = 1;` `end``end``if flag == 1` `disp('the matrix is not positive definite')` `else` `disp('the matrix is positive definite')``end`
Javad Taghiataghia.javad@gmail.comhowtoidentifyamatrixispositivedefinite1
http://sites.google.com/feeds/content/site/occasionalnotes/73406831372110656702015-02-24T02:35:06.945Z2015-07-02T12:26:14.769Z2015-07-02T12:26:12.614ZPivoting
Matlab code:
`function R = pivot(M, r, c) % r and c are pivoting point `
`[d, w] = size(M); % Get matrix dimensions`
`R = zeros(d, w); % Initialize to appropriate size`
`R(r,:) = M(r, :) / M(r,c); % Copy row r, normalizing M(r,c) to 1`
`for k = 1:d % For all matrix rows`
`if (k ~= r) % Other then r`
`R(k,:) = M(k,:) ... % Set them equal to the original matrix`
`- M(k,c) * R(r,:); % Minus a multiple of normalized row r, making R(k,c)=0`
`end`
`end`
`end`

eg: A = [1 2 3; 2 3 4]; B = pivot(A, 1, 1);