For some reason M[1][1] is not working in VEX, but you can always use getcomp(M, 1, 1).
for (int row = 0; row < 4; row++)
{
string out = "";
for (int col = 0; col < 4; col++)
{
float value = getcomp(4@test, row, col);
out += sprintf("%g ", value);
}
printf(out + "\n");
}
Matrices in Houdini are not m×n arrays, but 4-, 9- and 16-float "vectors". They rarely used as storage, as there is one-dimension arrays available for this purpose. Python is generally used for more sophisticated arrays manipulation. NumPy available by default.
import numpy
node = hou.pwd()
geo = node.geometry()
mat = geo.floatListAttribValue('test');
val = numpy.array(mat).reshape((4, 4))
print(val)
print_matrix.hipnc