LU三角分解(matlab程序)
来源:互联网 发布:手机数据可以恢复吗 编辑:程序博客网 时间:2024/06/01 08:50
A=[1,2,3;1,3,5;1,3,6];
b=[2,3,4];
x=grout(A,b);
function x=grout(B,c)
n=size(B,1);
L=eye(n);
U=zeros(n);
for i=1:n
s=0;
t=0;
for j=1:i-1
s=s+L(i,j)*U(j,i:n);
t=t+L(i+1:n,j)*U(j,i);
end
U(i,i:n)= B(i,i:n)-s;
L(i+1:n,i)=(B(i+1:n,i)-t)/U(i,i);
end
y=grout1(L,c);
x=grout2(U,y);
function y=grout1(B,c)
n=size(B,1);
y=zeros(n,1);
for i=1:n
s=0;
for j=1:i-1
s=s+B(i,j)*y(j);
end
y(i)=c(i)-s;
end
end
function x=grout2(U,y)
n=size(U,1);
x=zeros(n,1);
for i=n:-1:1
s=0;
for j=n:-1:i+1
s=s+U(i,j)*y(j);
end
x(i)=(y(i)-s)/U(i,i);
end
end
b=[2,3,4];
x=grout(A,b);
function x=grout(B,c)
n=size(B,1);
L=eye(n);
U=zeros(n);
for i=1:n
s=0;
t=0;
for j=1:i-1
s=s+L(i,j)*U(j,i:n);
t=t+L(i+1:n,j)*U(j,i);
end
U(i,i:n)= B(i,i:n)-s;
L(i+1:n,i)=(B(i+1:n,i)-t)/U(i,i);
end
y=grout1(L,c);
x=grout2(U,y);
function y=grout1(B,c)
n=size(B,1);
y=zeros(n,1);
for i=1:n
s=0;
for j=1:i-1
s=s+B(i,j)*y(j);
end
y(i)=c(i)-s;
end
end
function x=grout2(U,y)
n=size(U,1);
x=zeros(n,1);
for i=n:-1:1
s=0;
for j=n:-1:i+1
s=s+U(i,j)*y(j);
end
x(i)=(y(i)-s)/U(i,i);
end
end
阅读全文
0 0
- LU三角分解(matlab程序)
- 矩阵的LU分解(Matlab程序)
- 矩阵分解 三角分解(LU分解)
- MATLAB的LU分解
- LU分解(matlab实现)
- 从高斯消元到矩阵的三角分解(LU)
- LU分解(Doolittle分解)解线性方程组(Matlab版)
- LU 分解 (LU Decomposition)
- LU分解Matlab算法分析
- matlab实现矩阵LU分解
- 数值计算-线性方程组求解(1)-LU分解-MATLAB实现
- Matlab与线性代数--矩阵的LU分解
- 矩阵分解(1) LU分解
- LU分解不分块的C程序
- LU分解
- LU分解
- LU分解
- LU分解
- 43. Multiply Strings
- Configure GRUB2 Boot Loader Settings In Ubuntu 16.04
- 【自考总结】在摸索中找方法--2017.10.22
- java中的swing组件、主要三大布局管理器的应用
- NoSQL概述(已迁移)
- LU三角分解(matlab程序)
- 关于微机原理个人的一些总结(1)
- jquery-easyui-datagrid,弹框
- Rust: 逆序输出&str
- FAST角点检测原理及其C/C++实现
- 雅可比迭代法解线性方程组(matlab程序)
- KNN(NearestNeighbor)临近算法,自然语言讲解
- I2C、SPI和UART、
- Mybatis学习笔记一