gauss.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 21 行

M
21
字号
function x = gauss (A,b)
%----------------------------------------------------------------
% Usage:       x = gauss (A,b)
%
% Description: Solve linear algebraic system, Ax = b, using
%              Gaussian elimination. 
%
% Inputs:      A = m by n coefficient matrix 
%              b = m by 1 right-hand side vector
%
% Outputs:     x = n by 1 solution vector
%
% Note:        A must be of full rank.  If m ~= n, then the
%              minimum least-squares solution of Ax = b is
%              computed.
%----------------------------------------------------------------
   chkvec (b,2,'gauss');
   x = A\b;
%----------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?