Re: Manipulating a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg59265] Re: [mg59212] Manipulating a matrix
- From: stephen layland <layland at wolfram.com>
- Date: Wed, 3 Aug 2005 01:20:07 -0400 (EDT)
- References: <200508020442.AAA16742@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
and thus spake Ramier [2005.08.01 @ 23:54]:
> Hello everyone,
>
> I think that my question is rather simple and maybe I ought to go
> deeper into Mathematica book:
> I have a n x n matrix and I'd like to remove the first line and the
> first column in order to get the (n-1)x(n-1) matrix with the entries
> remaining. Is there a simple way to do that ?
Sure. Take a look at the help for Part[].
Here's the shorthand:
In[1]:= (x=Table[i j,{i,5},{j,5}])//MatrixForm
Out[1]//MatrixForm= 1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
In[2]:= x[[Range[2,5],Range[2,5]]//MatrixForm
Out[2]//MatrixForm= 4 6 8 10
6 9 12 15
8 12 16 20
10 15 20 25
--
/*------------------------------*\
| stephen layland |
| Documentation Programmer |
| http://members.wri.com/layland |
\*------------------------------*/
- References:
- Manipulating a matrix
- From: "Ramier" <wissam2@online.fr>
- Manipulating a matrix