Good day to all,(adsbygoogle = window.adsbygoogle || []).push({});

I'm trying to construct a m x m (size) matrix which have 1/2 on the diagonal, zeros to the lower triangular and 1 to the upper triangular.

m=10;

f[i_,j_]:=1/2 /i==j

f[i_,j_]:=1 /i>=j

f[i_,j_]:=0 /i<j

m=Array[f,{m,m}];

m //MatrixForm

I think, supposedly this will works but the answer came out with a matrix 'True'

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"},

{"True", "True", "True", "True", "True", "True", "True", "True",

"True", "True"}

Anybody could enlightened me, please.

thank you in advance.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica - Construct a Matrix

**Physics Forums | Science Articles, Homework Help, Discussion**