MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Question: getting list data into a matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17260] Re: Question: getting list data into a matrix
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 30 Apr 1999 02:34:44 -0400
  • Organization: Universitaet Leipzig
  • References: <7g0smo$dv9@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Ben,

MakeMatrix[l:{_Equal..},vec_List]:=
	  Module[{eqns,m,b},
		  eqns=l /. a_==b_ /; b!=0 :> a-b;
		  m=Outer[D[#1,#2] &,eqns ,vec];
		  b= m.vec-eqns;
		 {m,b}
		]

will return a list of the matrix of the linear system and the
right-hand side vector. If you call it with the list of linear
equations and the vector of unkowns

Hope that helps
  Jens

Ben Johnson wrote:
> 
> I'm trying to convert some equations from a list into a matrix to solve.
> 
> The data is in a list that looks like this:
> 
> {2 a[1]+3 b[1]+4 c[1]==0, 2 a[2]+4b[6]==24} etc.
> 
> Any help would be appreciated.  Please reply to bdjohns1 at uiuc.edu - my
> header address will work, but it's a spam-trap.
> 
> Thanks in advance for any help.
> 
> --
> Ben Johnson
> bdjohns1-usenet at uiuc.edu
> (remove -usenet to reply)


  • Prev by Date: Re: Complex Ratio Polynomial Fit
  • Next by Date: Re: Solving Eigenvalue Problems
  • Previous by thread: Re: Question: getting list data into a matrix
  • Next by thread: Re: AxesFront