rowcomb.m

来自「线性代数实验及MATLAB入门,电子工业出版社出版 陈怀琛 龚杰民合著」· M 代码 · 共 14 行

M
14
字号
function B=rowcomb(A,i,j,c)
% The command rowcomb(A,i,j,c) forms a matrix
% from A by adding c times the ith row of A
% to the jth row.
[m,n]=size(A);
if i<1|i>m|j<1|j>m
   error('Index out of range')
end
if i==j
   error('Illegal row operation')
end
B=A;
B(j,:)=c*A(i,:)+A(j,:);

⌨️ 快捷键说明

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