From help-request at octave dot org Mon Jun 6 12:06:13 2005 Subject: Re: set of linear equations ax = b From: Paul Roberts To: csanyipal at sks dot co dot yu Cc: help at octave dot org Date: Mon, 6 Jun 2005 10:04:56 -0700 Hi Paul, The problem is the your B is a row vector when it needs to be a column vector. Try: B = [6;-7;6]; regards, Paul On 6/6/05, Csanyi Pal wrote: > Hello! > > I have the following set of linear equations: > 2x - y + 3z = 6 > -4x + 2y -z = -7 > 2x + y + 5z = 6 > > I made the matrixes: > A = [2, -1, 3; -4, 2, -1; 2, 1, 5] > B = [6,-7,6] > > and then, to solve the set of linear equations, do: > A \ B > > but get the error: > error: operator \: nonconformant arguments (op1 is 3x3, op2 is 1x3) > error: evaluating binary operator `\' near line 16, column 3 > > or > inv (A) * B > > and get the error: > error: operator *: nonconformant arguments (op1 is 3x3, op2 is 1x3) > error: evaluating binary operator `*' near line 16, column 9 > > So what's wrong? Thanks! > > -- > Regards, > Paul > ->->-> Debian Junior Project :-) :-) :-) :-) :-) :-) :-) :-) :-) > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------