[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set of linear equations ax = b
From: |
Paul Roberts |
Subject: |
Re: set of linear equations ax = b |
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 <address@hidden> 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
-------------------------------------------------------------