I want to create a
n Identity matrix and replace the ones with
NOS is three here (it is a number). The code I have written for this doesn't work.
Kin = IdentityMatrix[NOS] n = 1; m = 1; While[n == m && n < NOS && m < NOS, Kin[[n, m]] -> n π^2; n++; m++]
Kin[[1, 1]]== π^2 Kin[[2, 2]]==2 π^2
and so on. Could anyone help me with this please?