Re: Solving linear systems in matrix notation?
- To: mathgroup at smc.vnet.net
- Subject: [mg68250] Re: Solving linear systems in matrix notation?
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Sun, 30 Jul 2006 04:48:42 -0400 (EDT)
- References: <eaeqr6$57n$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ben schrieb:
> Hi,
>
> 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}]
>
> cheers,
>
> Ben C.
>
Ben,
you might use LinearSolve and a self defined Function e.g.
myLSolve[a__]:=LinearSolve[Most/@List[a],Last/@List[a]]
In[1]:= myLSolve[{2,4,-4},{5,7,11}]
Out[1]= {12,-7}
Gruss Peter
--
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de