A new release for GNU Octave
A new release for GNU Octave
Posted Dec 17, 2020 10:02 UTC (Thu) by xyz (subscriber, #504)In reply to: A new release for GNU Octave by bneven
Parent article: A new release for GNU Octave
It is not idiomatic as the usual way would be to use the left division operator, also following the usual notation the matrix is represented with a capital letter:
>> A = [1 2 3; 3 2 1; 2 2 2];
>> b = [2 2 2]';
>> A \ b
warning: matrix singular to machine precision
ans =
0.3333
0.3333
0.3333
As you see Octave is saying that within the used precision the matrix is non-invertible and so the solution is not unique.
Regarding linsolve this is what the first lines have to say about it. (TL;DR linsolve is an advance frontend when used with other options)
>> help linsolve
'linsolve' is a function from the file /home/jamatos/devel/octave/scripts/linear-algebra/linsolve.m
-- X = linsolve (A, B)
-- X = linsolve (A, B, OPTS)
-- [X, R] = linsolve (...)
Solve the linear system 'A*x = b'.
With no options, this function is equivalent to the left division
operator ('x = A \ b') or the matrix-left-divide function
('x = mldivide (A, b)').
....