MathGroup Archive 2000

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

Search the Archive

RE: Could we build matrix with codition instruction?


----- Original Message ----- 
From: Coase Yang <cnc at ms6.hinet.net>
To: mathgroup at smc.vnet.net
Subject: [mg23346] [mg23314] Could we build matrix with codition instruction?


> 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

This is the matrix you want:
M=Table[If[j>i, 1, 0],{i,4},{j,4}]

Higinio Ramos



  • Prev by Date: Random Geometric
  • Next by Date: The most efficient Fibonacci algorithim?
  • Previous by thread: Could we build matrix with codition instruction?
  • Next by thread: Re: Could we build matrix with codition instruction?