Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
See the recommended documentation of this function
(\) left matrix division.
Backslash denotes left matrix division.
x=A\b is a solution to
A is square and non-singular
x=A\b (uniquely defined) is equivalent to
x=inv(A)*b (but the computations are much cheaper).
A is not square,
x is a least square solution,
norm(A*x-b) is minimal (Euclidean norm). If
A is full
column rank, the least square solution,
x=A\b, is uniquely
defined (there is a unique
x which minimizes
A is not full column rank, then the least square
solution is not unique, and
x=A\b, in general, is not the solution
with minimum norm (the minimum norm solution is
A.\B is the matrix with
B) is a scalar
A.\B is equivalent to
A\.B is an operator with no predefined meaning. It may be used
to define a new operator (see overloading) with the same precedence as
A=rand(3,2);b=[1;1;1]; x=A\b; y=pinv(A)*b; x-y A=rand(2,3);b=[1;1]; x=A\b; y=pinv(A)*b; x-y, A*x-b, A*y-b // if rank is deficient A=rand(3,1)*rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b A=rand(2,1)*rand(1,3); b=[1;1]; x=A\b; y=pinv(A)*b; A*x-b, A*y-b // A benchmark of several linear solvers [A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa"); b = zeros(size(A,1),1); tic(); res = umfpack(A,'\',b); mprintf('\ntime needed to solve the system with umfpack: %.3f\n',toc()); tic(); res = linsolve(A,b); mprintf('\ntime needed to solve the system with linsolve: %.3f\n',toc()); tic(); res = A\b; mprintf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
|Report an issue|
|<< ans||Scilab keywords||brackets >>|