You can use a Generators > "Hilbert 3d" node to make the matrix. I'll use this for brevity. Either that or stack a few subdivided planes and join them with Mesh Join.
Each point on the matrix is a Vector, you wanted to check the distance between each vector and the origin vector (0,0,0) and use that distance to scale a sphere placed on that vector point.