backslash () - Left matrix division. (original) (raw)
Scilab 5.3.3
- Scilab help
- Scilab
- Scilab keywords
- ans
- backslash (\)
- brackets
- case
- colon
- comma
- comments
- comparison
- do
- dot
- else
- elseif
- empty
- end
- equal
- for
- global
- hat
- if then else
- left
- less
- minus
- not
- parents
- percent
- plus
- power
- quote
- return
- select
- semicolon (;)
- slash
- star
- then
- tilda
- try
- while
Please note that the recommended version of Scilab is 2026.0.1. This page might be outdated.
See the recommended documentation of this function
Scilab help >> Scilab > Scilab keywords > backslash (\)
Calling Sequence
Description
Backslash denotes left matrix division. x=A\b is a solution to A*x=b.
If A is square and nonsingular x=A\b (uniquely defined) is equivalent to x=inv(A)*b (but the computations are much cheaper).
If A is not square, x is a least square solution. i.e. norm(A*x-b) is minimal (euclidian norm). If A is full column rank, the least square solution, x=A\b, is uniquely defined (there is a unique x which minimizes norm(A*x-b)). If 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 x=pinv(A)*b).
A.\B is the matrix with (i,j) entry A(i,j)\B(i,j). If A (or B) is a scalar A.\B is equivalent to A*ones(B).\B (or A.\(B*ones(A))
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 * or /.
Examples
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, Ax-b, Ay-b A=rand(3,1)rand(1,2); b=[1;1;1]; x=A\b; y=pinv(A)b; Ax-b, Ay-b A=rand(2,1)rand(1,3); b=[1;1]; x=A\b; y=pinv(A)b; Ax-b, Ay-b
[A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/examples/bcsstk24.rsa");
tic(); res = umfpack(A,'',b); printf('\ntime needed to solve the system with umfpack: %.3f\n',toc());
tic(); res = linsolve(A,b); printf('\ntime needed to solve the system with linsolve: %.3f\n',toc());
tic(); res = A\b; printf('\ntime needed to solve the system with the backslash operator: %.3f\n',toc());
See Also
- slash — (/) right division and feed back
- inv — matrix inverse
- pinv — pseudoinverse
- percent — (%) special character
- ieee — set floating point exception mode
- linsolve — linear equation solver
- umfpack — solve sparse linear system