If you're declaring a multi-dimensional array (as opposed to a jagged array), then you could do something like this:
double[,,] matrix = new double[3,3,3];
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
matrix[i, j, k] = i * j * k; // Or whatever
A jagged array wouldn't be a whole lot different, but you'd declare it as double[][][] and reference elements as matrix[i][j][k]. A multi-dimensional array is recommended in this case. You can read more information about the difference by reading about Arrays[^] in the C# Language Specification.
Microsoft MVP, Visual C# My Articles