MathGroup Archive 2004

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

Search the Archive

Re: Part of a matrix or array

  • To: mathgroup at
  • Subject: [mg51356] Re: [mg51334] Part of a matrix or array
  • From: "David Park" <djmp at>
  • Date: Fri, 15 Oct 2004 02:46:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Take seems pretty good.

mat = Array[f, {14, 14}];

Take[mat, {3, 7}, {11, 14}] // MatrixForm

The following might be more intuitive, but Range is a function.

mat[[Range[3, 7], Range[11, 14]]] // MatrixForm

The MatrixManipulation package isn't any simpler.


TakeMatrix[mat, {3, 11}, {7, 14}] // MatrixForm

David Park
djmp at 

From: Gregory Lypny [mailto:gregory.lypny at]
To: mathgroup at

Hello everyone,

Mathematica has so many functions for accessing parts of arrays that 
I'm not sure which one I should be using to get a submatrix, for 
example, rows 3 to 7 and columns 11 to 14 of matrix X.  Should I use 


Is there a more compact way where I don't have to explicit refer to a 



  • Prev by Date: Re: Solving an equation
  • Next by Date: Re: Solving an equation
  • Previous by thread: Re: Part of a matrix or array
  • Next by thread: GUIKit / GraphEditor - java code for SetPropertyValue[]