matlab输入输出参数都是矩阵,编制一个matlab函数文件,输入参数是一个m*n的矩阵,输出......

这是一个MATLAB函数rref的实现,用于计算矩阵的简化行阶梯形形式。函数接受一个m*n矩阵作为输入,并根据给定的公差返回矩阵及其秩。在函数内部,它通过查找最大元素、交换行和除以主元来逐步处理矩阵。如果输入元素为有理数,函数会返回相应的有理数形式。问题在于运行时第24行出现错误,需要进一步调查原因。
摘要由CSDN通过智能技术生成

function [A,jb] = rref(A,tol)

%RREF   Reduced row echelon form.

%   R = RREF(A) produces the reduced row echelon form of A.

%

%   [R,jb] = RREF(A) also returns a vector, jb, so that:

%       r = length(jb) is this algorithm's idea of the rank of A,

%       x(jb) are the bound variables in a linear system, Ax = b,

%       A(:,jb) is a basis for the range of A,

%       R(1:r,jb) is the r-by-r identity matrix.

%

%   [R,jb] = RREF(A,TOL) uses the given tolerance in the rank tests.

%

%   Roundoff errors may cause this algorithm to compute a different

%   value for the rank than RANK, ORTH and NULL.

%

%   Class support for input A:

%      float: double, single

%

%   See also RANK, ORTH, NULL, QR, SVD.

%   Copyright 1984-2005 The MathWorks, Inc.

%   $Rev

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值