Are there such things as 3-dimensional (and higher) analogues of matrices, and if so, do they have any applications? A matrix is a group of numbers arranged in a rectangle. I wonder, has anyone studied 3-dimensional and higher analogues of matrices? For example, there could be such a thing as a 2 by 2 by 2 3d matrix, whose entries are all equal to 1. Has anyone else defined these entities, and more importantly, are they used in mathematics?

I will just elaborate a little on a famous example alluded to in previous comments/answers:
Suppose you start at the North pole and walk forwards straight down to the equator, then sidestep one quarter of the way round the equator, before walking backwards to the North pole.  Then all your walking was along straight lines (geodesics) and you never turned - yet at the end you are back where you started, but facing $\pi/2$ radians to the direction you started.  In effect you have been turned by the curvature of the surface of the Earth.
If you divide the amount you got turned $(\pi/2)$ by the area you have traversed around $(4\pi R^2)/8$, then you get the curvature of the Earth: $\frac1{R^2}$.  We are assuming the Earth is a perfect sphere here.
More generally,  given a point on a surface, you can take a small square and divide the amount you get turned going around the square, by its area.  Taking the limit as the area of the square shrinks to $0$ gives you the curvature of the surface at that point.
Now suppose we have a point in an $n$-dimensional space.  We must pick two co-ordinate axis' to draw our little square parallel to.  Then we must pick two more co-ordinate axis' so we can see how much a vector pointing along the first, gets turned into the second.  Then along these four co-ordinate axis' we can take the limit as before, of angle turned divided by area.
Doing this for all combinations of co-ordinate axis', we get an $n\times n\times n\times n$ grid of numbers called the Riemann curvature tensor.  Einstein's field equations equation from general relativity relate these numbers for the curvature of spacetime, to the Stress-energy tensor - intuitively describing how matter curves the space around it.
