Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Linear Algebra > Linear Equations > linsolve

linsolve

solucionador de equações lineares

Seqüência de Chamamento

[x0,kerA]=linsolve(A,b [,x0])

Parâmetros

A

uma matriz na x ma de reais (possivelmente esparsa)

b

um vetor na x 1 (mesma dimensão de linha de A)

x0

um vetor de reais

kerA

uma matriz ma x k de reais

Descrição

linsolve computa todas as soluções para A*x+b=0 .

x0 é uma solução particular (se houver) e kerA=núcleo de A. Qualquer x=x0+kerA*w com w arbitrário satisfaz A*x+b=0.

Se um compatible x0 compatível é dado na entrada, x0 é retornado. Senão, um x0, compatível é retornado, se houver.

Exemplos

A=rand(5,3)*rand(3,8);
b=A*ones(8,1);[x,kerA]=linsolve(A,b);A*x+b   //b comatível
b=ones(5,1);[x,kerA]=linsolve(A,b);A*x+b   //b incompatível
A=rand(5,5);[x,kerA]=linsolve(A,b), -inv(A)*b  //x é único

// A benchmark of sparse linear solver

[A,descr,ref,mtype] = ReadHBSparse(SCI+"/modules/umfpack/demos/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
<< inv Linear Equations lsq >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:35:22 CET 2022