You can also do it in one go:
Only the first element of the second column.
trans_mat <- array(0, dim = c(3, 3, 5))
trans_mat[1, 2, ] <- c(0.05, 0.06, 0.07, 0.08, 0.09)
, , 1
[,1] [,2] [,3]
[1,] 0 0.05 0
[2,] 0 0.00 0
[3,] 0 0.00 0
, , 2
[,1] [,2] [,3]
[1,] 0 0.06 0
[2,] 0 0.00 0
[3,] 0 0.00 0
, , 3
[,1] [,2] [,3]
[1,] 0 0.07 0
[2,] 0 0.00 0
[3,] 0 0.00 0
, , 4
[,1] [,2] [,3]
[1,] 0 0.08 0
[2,] 0 0.00 0
[3,] 0 0.00 0
, , 5
[,1] [,2] [,3]
[1,] 0 0.09 0
[2,] 0 0.00 0
[3,] 0 0.00 0
The full matrix filled with the same number:
array(rep(c(0.05, 0.06, 0.07, 0.08, 0.09), each = 3*3), dim = c(3, 3, 5))
output
, , 1
[,1] [,2] [,3]
[1,] 0.05 0.05 0.05
[2,] 0.05 0.05 0.05
[3,] 0.05 0.05 0.05
, , 2
[,1] [,2] [,3]
[1,] 0.06 0.06 0.06
[2,] 0.06 0.06 0.06
[3,] 0.06 0.06 0.06
, , 3
[,1] [,2] [,3]
[1,] 0.07 0.07 0.07
[2,] 0.07 0.07 0.07
[3,] 0.07 0.07 0.07
, , 4
[,1] [,2] [,3]
[1,] 0.08 0.08 0.08
[2,] 0.08 0.08 0.08
[3,] 0.08 0.08 0.08
, , 5
[,1] [,2] [,3]
[1,] 0.09 0.09 0.09
[2,] 0.09 0.09 0.09
[3,] 0.09 0.09 0.09