RE: Could we build matrix with codition instruction?
- To: mathgroup at smc.vnet.net
- Subject: [mg23351] RE: [mg23314] Could we build matrix with codition instruction?
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 4 May 2000 02:59:18 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> From: Coase Yang [mailto:cnc at ms6.hinet.net] To: mathgroup at smc.vnet.net > Dear All: > > I want to construct an 4*4 upper triangular matrix with > conditional instruction, a[i,j]: > if j-i>=0, then a[[i,j]]=1 > if j-i<0, then a[[i,j]]=0 > Could anyone tell me how I could build this matrix with > list or Table form by conditional instruction inside? > > Thank you very much. > > Coase Yang > Table[If[j - i >= 0, 1, 0], {i, 1, 4}, {j, 1, 4}] {{1, 1, 1, 1}, {0, 1, 1, 1}, {0, 0, 1, 1}, {0, 0, 0, 1}} David Park djmp at earthlink.net http://home.earthlink.net/~djmp/