資源簡(jiǎn)介
Matlab編寫的LU分解解線性方程組,已經(jīng)調(diào)試成功.
代碼片段和文件信息
%??2014/10/21??17:11
%??This?is?a?self_programmed?process?implementing?the?LU?decomposition
%??method?which?is?one?of?the?most?classic?metheds.
function?[lux]=lu_le(ab)
y=zeros(size(b));
u=zeros(size(a));
l=eye(size(a));
dim_n=size(a1);
dim_m=size(a2);
%?flag=0;
if?det(a)==0
????disp(‘The?determinant?of?the?coefficient‘‘s?matrix?is?zero?!‘);
elseif?dim_n~=dim_m
????disp(‘The?coefficient‘‘s?matrix?has?unequal?rows?and?columns‘)
else
????u(11)=a(11);
????for?i=2:dim_n
????????u(1i)=a(1i);
????????l(i1)=a(i1)/u(11);
????end
????for?r=2:dim_n
????????sumt_rr=0;
????????for?k=1:r-1
????????????sumt_rr=sumt_rr+l(rk)*u(kr);
????????end
????????u(rr)=a(rr)-sumt_rr;
????????for?j=r+1:dim_n
????????????sumt1=0;
????????????sumt2=0;
????????????for?k=1:r-1
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1366??2014-10-21?17:12??LU分解\LU\lu_le.m
?????文件????????189??2014-10-20?22:22??LU分解\LU\mainLU.asv
?????文件????????185??2014-10-21?17:12??LU分解\LU\mainLU.m
?????文件??????28955??2014-10-21?17:32??LU分解\LU.docx
?????目錄??????????0??2014-10-29?22:14??LU分解\LU
?????目錄??????????0??2014-10-29?22:14??LU分解
-----------?---------??----------?-----??----
????????????????30695????????????????????6
評(píng)論
共有 條評(píng)論