Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: matrix operations

  • To: mathgroup at
  • Subject: [mg46376] Re: [mg46354] matrix operations
  • From: Yasvir Tesiram <yat at>
  • Date: Mon, 16 Feb 2004 23:42:02 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

Here are some suggestions;

(* here is a 6x6 matrix*)

(mat = Array[f, {6, 6}]) // MatrixForm

(* note, I don't want mat wrapped with Head MatrixForm, hence the 
(* load up the MatrixManipulation package*)


(* extract a column and Flatten it so that you can use it as a vector*)
col1 = TakeColumns[mat, {2}] // Flatten

(* suppose you want every odd column which you can use later as an 
array of  vectors*)
oddcols = (TakeColumns[mat, {#}] // Flatten) & /@ {1, 3, 5}

(* suppose you want a submatrix which is a 3x3 matrix on the top left*)

(submat3x3 = TakeMatrix[mat, {1, 1}, {3, 3}]) // MatrixForm

There are many other ways, using Part and Take, however I have found 
the MatrixManipulation Package useful for small matrices. There are 
also functions to AppendRows and Columns.


On Feb 16, 2004, at 7:59 AM, paolo tarpanelli wrote:

> How can i extract a column from a matrix and transform that column in 
> a vector to make operation with this???
> Thanks
> Paolo

  • Prev by Date: Re: Help Browser issue in 5.0.1 on Mac OS X
  • Next by Date: RE: matrix operations
  • Previous by thread: Re: matrix operations
  • Next by thread: Re: matrix operations