I need to construct special matrix in mathematica which is given in the following image
Answer
The Array
command provides a simple way to transform a function into a matrix.
n = 6;
η = ConstantArray[1, n+1];
η[[1]] = 2;
a = Array[{i, j} \[Function] UnitStep[i - j] Mod[i - j, 2] 4 (i - 1)/η[[j]], {n+1, n+1}];
a // TeXForm
(0000000200000008000006012000001601600010020020000240240240)
Is this what you are looking for? Zero-based indexing is quite untypical in mathematics...
Comments
Post a Comment