Lu decomposition help needed
1 次查看(过去 30 天)
显示 更早的评论
this is as far as i have got can anyone help me?
function [L,U] = LUdecomp(A)
n = size(A,1); %number of rows
m = size(A,2); %number of cols
% Check to see if the input matrix is a square
if n~=m
error('The input matrix is not square')
end
U = A; %The U matrix will be what is left after G.E. with the matrix A
L = eye(n); %The L matrix will be what is left after G.E. applied to the identity matrix
for i = 1:n-1 %i is the current column that you are trying to create zeros for in U
for j = i+1:n %j is the current row that you are trying to create the zero in
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!