Re: matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg28397] Re: matrix
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Mon, 16 Apr 2001 03:28:49 -0400 (EDT)
- References: <9bb759$92p@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Continuiing on the line of Carl Woll's recent posting "Re: SpecialMatrix",
it looks as if the following should be pretty efficient:
Block[{mat = Take[IdentityMatrix[4000], All, 1220]}, mat[[All, All]] = 0;
mat[[Range[216, 220], All]] = 1; mat];
--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
"Su Su Win" <susuwin at post.kek.jp> wrote in message
news:9bb759$92p at smc.vnet.net...
> Hello,
>
> How can I make a matrix (4000x1220) with zeros except that all the values
at
> 216th to 220th rows are ones.
> Thank you very much in advance.
> Regards, Win
>
>
>
>