Re: matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg28405] Re: [mg28383] matrix
- From: BobHanlon at aol.com
- Date: Mon, 16 Apr 2001 03:28:58 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Using a smaller example, let the matrix be 10 by 5 and rows 4 through 7 will be ones. nbrRows = 10; nbrCols = 5; startOnesRow = 4; lastOnesRow = 7; mat = Join[ Table[0, {startOnesRow-1}, {nbrCols}], Table[1, {lastOnesRow-startOnesRow+1}, {nbrCols}], Table[0, {nbrRows-lastOnesRow}, {nbrCols}]] {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}} Bob Hanlon In a message dated 2001/4/15 6:10:12 AM, susuwin at post.kek.jp writes: >How can I make a matrix (4000x1220) with zeros except that all the values >at >216th to 220th rows are ones.