Re: Solving linear systems in matrix notation?
- To: mathgroup at smc.vnet.net
- Subject: [mg68285] Re: Solving linear systems in matrix notation?
- From: Ben <ben.carbery at spam.me>
- Date: Mon, 31 Jul 2006 03:45:55 -0400 (EDT)
- References: <eaeq6a$52u$1@smc.vnet.net> <eahtij$ots$1@smc.vnet.net>
- Reply-to: ben.carbery at spam.me
- Sender: owner-wri-mathgroup at wolfram.com
Jean-Marc Gulliet wrote: > Ben wrote: >> I have been following a tutorial that says to solve systems of linear equations like so: >> >> Solve[{2x + 4y == -4, 5x + 7y == 11}, {x, y}] >> >> I am wondering if there is a shorthand way to do it by just entering the co-efficients of each equation, i.e. matrix style: >> >> Solve??[{2,4,-4},{5,7,11}] > > LinearSolve [1] does what you are looking for. > > m = {{2, 4}, {5, 7}} > b = {-4, 11} > LinearSolve[m, b] > > returns the vector {12, -7}. > > In addition, the function LinearEquationsToMatrices from the standard > package LinearAlgebra`MatrixManipulation` might be of interest. > > Best regards, > Jean-Marc > > [1] http://documents.wolfram.com/mathematica/functions/LinearSolve > Too easy, thanks all.