英语翻译一、高斯消去法的程序:function [A,b]= Gauss(A,b);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%use Gaussian elimination method to change 'A' into upper triangular matrix% Nov 26,2008%%%%%%%%%%%%%%%

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 08:57:28
英语翻译一、高斯消去法的程序:function [A,b]= Gauss(A,b);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%use Gaussian elimination method to change 'A' into upper triangular matrix% Nov 26,2008%%%%%%%%%%%%%%%

英语翻译一、高斯消去法的程序:function [A,b]= Gauss(A,b);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%use Gaussian elimination method to change 'A' into upper triangular matrix% Nov 26,2008%%%%%%%%%%%%%%%
英语翻译
一、高斯消去法的程序:
function [A,b]= Gauss(A,b);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%use Gaussian elimination method to change 'A' into upper triangular matrix
% Nov 26,2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[m,n]=size(A); %get the size of matrix 'A'
% column pivotal elimination method
for k=1:n-1
[v,u]=max(abs(A(k:n,k))); %select the maximum element into the kth
%column of matrix A(k:n,1:k)
u=u+k-1; %because function max return the index of maximum values
%of A(k:n,1:k) so we should change it into the value of
%matrix A
p(k)=u; %record the index u
%exchange the row of k and u
t1 = A(k,k:n); %temporary variable t1
A(k,k:n) = A(u,k:n);
A(u,k:n) = t1;
t2 = b(k); %temporary variable t2
b(k) = b(u);
b(u) = t2;
% Gauss elimination method
if A(k,k) = 0
rows=k+1:n
A(rows,k)=A(rows,k)/A(k,k);
A(rows,rows)=A(rows,rows)-A(rows,k)*A(k,k);
L(rows,rows)=A(rows,rows);
end
end
% calculate the matrix U
for k=2:n
A(k,1:k-1)=0;
end
二、求解三角方程组的程序:
function x= Eqn_Root(A,b);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calculate the solution of upper triangular equations set Ax=b
% Nov 26,2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[m,n]=size(A); %get the size of matrix 'A'
%x(n)=b(n)/A(n,n); %calculate x(n)
% calculate the solution
for i = n :-1 :1
t = 0;
for j = n :-1 :i+1
t = t+A(i,j)*x(j);
end
x(i) = (b(i)-t)/A(i,i);
end
三、主程序:
function Examples_Eqn_Root
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% use the Gauss method to solve the linear equations Ax=b
% Nov 26,2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = [ 1 3 6 8 9 2; %input the value of 'A'
2 5 3 1 6 3;
3 6 1 2 8 5;
2 6 8 9 3 8;
5 8 9 3 2 3;
3 5 8 1 7 2];
b= [2 -3 2 55 16 -6]; %input the value of 'b'
b = b'; %take the transpose of 'b'
[A,b]= Gauss(A,b) %change the matrix 'A' into upper triangular matrix
%return the new array 'b'
b = b'
x= Eqn_Root(A,b) %calculate the upper triangular quations set
end
如题.翻译下注释就可以了
不要用在线翻译.稍微知道点的来回答下= =

英语翻译一、高斯消去法的程序:function [A,b]= Gauss(A,b);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%use Gaussian elimination method to change 'A' into upper triangular matrix% Nov 26,2008%%%%%%%%%%%%%%%
一楼翻译是什么东西啊?直接复制到google在线里翻译出来,还累?我看别人要想看懂才真是累!给楼主翻译了下,如果楼主对高斯消去法比较了解的话就很容易懂.
%用高斯消去法把矩阵A转换为上三角阵
[m,n]=size(A); %获得A的行和列分别存入m和n中
% 列主元素消去法
for k=1:n-1
[v,u]=max(abs(A(k:n,k))); %选出A的第k列中绝对值最大元素存入v,而u是记录多少的行或列,并取最大值,比如有m行,n列,且n>m,则u=n
%计算矩阵A中这些元素 A(k:n,1:k)
u=u+k-1;
%因为函数返回矩阵A(k:n,1:k)中最大元素,因此我们应该变换矩阵A的值,下面进行变换
p(k)=u; %用p(k)来记录u的值
%交换第k行和第u行的数据
t1 = A(k,k:n); %为了实现交换,定义一个中间变量t1
A(k,k:n) = A(u,k:n);
A(u,k:n) = t1;
t2 = b(k); %t2是一个临时变量
b(k) = b(u);
b(u) = t2;
%前面主要是对A进行变换,即在进行消去之前,第一次先比较A中第一列绝对值最大的元素,然后再将第一列中有最大元素的那行交换到第1行,
然后用下面方法进行消去,将除第一行外的元素的第一列都消去为0;第二次然后比较A中第二列元素(此时第一行不用参与比较),将最大元素那行
交换到第二行,将3,4,5…行的第二列也变为0;依此类推,直到把A变为上三角阵,这也是为什么下面的A(k,k) = 0不为0的原因(有0就可省去一步)
% 高斯消去法
if A(k,k) = 0
%下面是高斯法消去的主要步骤,可参考有关书看看.
rows=k+1:n
A(rows,k)=A(rows,k)/A(k,k);
A(rows,rows)=A(rows,rows)-A(rows,k)*A(k,k);
L(rows,rows)=A(rows,rows);
end
end
% 计算矩阵 U
for k=2:n
A(k,1:k-1)=0;
end
二、求解三角方程组的程序:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 用转换为三角矩阵法来求解Ax=b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[m,n]=size(A); %获得A的行和列分别存入m和n中
%x(n)=b(n)/A(n,n); %计算x(n)
% 下面进行求解
for i = n :-1 :1
t = 0;
for j = n :-1 :i+1
t = t+A(i,j)*x(j);
end
x(i) = (b(i)-t)/A(i,i);
end
三、主程序:
function Examples_Eqn_Root
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 用高斯消去法求解线性方程 Ax=b
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = [ 1 3 6 8 9 2; %i输入矩阵 'A'
2 5 3 1 6 3;
3 6 1 2 8 5;
2 6 8 9 3 8;
5 8 9 3 2 3;
3 5 8 1 7 2];
b= [2 -3 2 55 16 -6]; %i输入 'b'
b = b'; %转换 'b'
[A,b]= Gauss(A,b) %把[A b]变换为A为上三角阵的形式
%同时将变换后的'b'返还给b
b = b'
x= Eqn_Root(A,b) %通过三角阵方法求解
end

英语翻译一、高斯消去法的程序:function [A,b]= Gauss(A,b);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%use Gaussian elimination method to change 'A' into upper triangular matrix% Nov 26,2008%%%%%%%%%%%%%%% Gauss消去法C语言程序 找列主元高斯消去法来求解线性代数方程组解的matlab程序 计算方法线性方程组的列主元消去法程序急,急 啊,谢谢啦. 用列主元高斯消去法解方程组Ax=b,解释矩阵三角分解法与列主元高斯消去法的异同用matbal 实现编个程序 用MATLAB实现 用列主元消去法,用c++编个程序 matlab用列主元高斯消去法解方程组,matlab用列主元高斯消去法解方程组 写出理论知识、设计思路、算法步骤(或流程图);写出程序清单(加上必要的注释);写出程序运行操作过程与输 高斯列主元消去法与高斯乔丹消去法的区别 程序运行结束后总是出现:Run-Time Check Failure #2 - Stack around the variable 'p' was corrupted.程序运行结果正确,经过我检查多遍并没有发现高斯消去函数的问题,主程序也不存在溢出的问题,纠结,#include c++ 高斯消去法 求线性方程组的解用列主元高斯消去法求解线性方程组AX=B的解(1) 系数矩阵(数组)和常数矩阵(数组)的输入要求编写独立函数实现;(2) 列主元高斯消去法(消元和回 高斯消去法求解线性方程组时,有时会出现误差较大甚至无法计算的现象.这句话是正确还是错误的? 高斯消去法解方程 的 原始矩阵中 可不可以含有 rt.能不能用于 非 唯一解 的情况呢? 在进行高斯计算时如何消去虚频 fortran77 解线性方程组程序用高斯消去法解N元一次方程组 区别加成反应消去反应取代反应并分别举出常见的反应总之,要让我会辨别高一阶段所有有机化学中属于加成反应.消去反应或是取代反应的列出方程式,最好加以说明 高斯列主元消去法求解线性方程组的方法 严格下策反复消去法的名词解释 高一算法与程序框图