I have this piece of code which populates a matrix following different rules depending on row and column number:
MQp := Array[Qp, {Length[a], Length[a]}];
Do[Qp[i, 1] = a[[i]], {i, 1, Length[a]}];
Do[Qp[1, j] = a[[j]]/2, {j, 2, Length[a]}];
Do[If[(i == j),
If[((2 j - 1) <= Length[a]), Qp[i, j] = a[[2 i - 1]]/2 + a[[1]],
Qp[i, j] = a[[1]]],
If[(i != 1 && j != 1),
If[(i + j - 1) <= Length[a],
Qp[i, j] = a[[i + j - 1]]/2 + a[[Abs[i - j] + 1]]/2,
Qp[i, j] = a[[Abs[i - j] + 1]]/2]]], {i, 1, Length[a]}, {j, 1,
Length[a]}];
Qp[1, 1] = a[[1]];
MatrixForm[MQp]
Currently "a" is a table of numerical values. I would like to generate a table of symbolic a's, and then be able to substitute the numerical values into the matrix. This way I can easily check that the values in the matrix correctly match what should be generated. I've tried several methods, but so far I get errors or nothing is output at all? Can someone help me out? Thanks in advance.
PS: How do I display code blocks correctly? I did a line and eight spaces but it looks like it didn't work.