MathGroup Archive 1998

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

Search the Archive

Re: combine two vectors to form matrix



s2700114@nickel.laurentian.ca wrote:
> 
> could any one tell me how to combine two lists(column vectors) into an n
> x 2 matrix?
> 
> Troy


{Flatten[vector1],Flatten[vector2]}.

by the way, lists in mathematica are, by default ROW vectors, not column
vectors. so a 1-D ROW vector looks like:

{1,2,3,4,5,6} 

while a 1-D COLUMN vector looks like

{{1},{2},{3},{4},{5},{6}} 

If, after this explanation, you decide that your lists were really ROW
vectors after all, then use:

{vector1,vector2}.


"Tour of mathematica" section on the mathematica book or on-line help. 
Without a basic knowledge of syntax and data structures, you are really
crippled in your abibility to use any programming language, mathematica
included.
-- 
Remove the _nospam_ in the return address to respond.



  • Prev by Date: Re: Compiling
  • Next by Date: Re: algebraic solutions
  • Prev by thread: Re: combine two vectors to form matrix
  • Next by thread: Re: combine two vectors to form matrix