![]() But the Octave result has 3 nonzero components. The matrix A is a 3*2 coefficient matrix, thus a good Matlab result should contain no more than 2 nonzero components. To resolve this conflict, Octave treats the expression as if you had typed (1). at ): Matlab returns "a basic solution, which has at most m nonzero components for an m-by-n coefficient matrix".Īnd in this sense the Octave result is incompatible to Matlab. GNU Octave A high-level interactive language for numerical computations Edition 3 for Octave version 2.1.x. Note that because Octaves element by element operators begin with a ‘.’, there is a possible ambiguity for statements like 1./m because the period could be interpreted either as part of the constant or as part of the operator. But the Matlab result has an additional property (well documented in its help, e.g. ![]() This is not automatically bad, since the system is underdetermined, and therefor has many solutions. ![]() ![]() Octave does what it says in the documentation, it returns a "minimum norm solution". GNU Octave is capable of solving Linear Algebra problems 1 Solving Ax b Solve the equations x + y 3 and 2x 3y 5 octave:1> A 1 1 2 -3, B 3 5’ A 1 1 2 -3 B 3 5 octave:2> AB ans 2.80000 0.20000 octave:3> inv(A)B ans 2.80000 0.20000 octave:4> A(AB) ans 3 5 Calculate determinant of a matrix: det(A) Calculate inverse. This is an UNDERdetermined system of linear equations to be solved with the slash operator. Here is a little script that shows the current Octave behavior (version 3.8.1):
0 Comments
Leave a Reply. |