Given some multidimensional matrix A. Get a matrix of the same size as A where all elements are replaced by their index along the kth dimension
Example
Input
A = ans(:,:,1) =
1 3 6 2
ans(:,:,2) =
6 9 7 6
Output:
f(A,1) = ans(:,:,1) =
1 1 2 2
ans(:,:,2) =
1 1 2 2
f(A,2) = ans(:,:,1) =
1 2 1 2
ans(:,:,2) =
1 2 1 2
f(A, 3) =
ans(:,:,1) =
1 1 1 1
ans(:,:,2) =
2 2 2 2
Deterministic solution would fail if you add at least one more test case for the 2-D or 4-D arrays.
5170 Solvers
583 Solvers
Return elements unique to either input
477 Solvers
369 Solvers
Solve the system of equations.
33 Solvers