I have a function that works for vector inputs but I need to run this on a cube. My impulse is I need to slice a vector out of the cube and then run it over a double for loop.
This is the pseudo code:
public static double[,,] cubefunction(double[,,] input)
{
int N = input.GetLength(0);
var outputvector = new double[N,N,N];
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
outputvector[1:N,i,j] = vectorfunction(input[1:N,i,j]);
}
}
return outputvector;
}
Obviously, 1:N
is matlab notation to grab the entire row. Is there an equivalent in C#? Or how would I go about this without triple looping?