Problem 2092. Find offset of an element of a multi dimensional matrix
For a given multi dimensional matrix and given element, find its offset from the 1st element.
Return 0, if element is not found in the matrix.
If the element is repeated in the matrix, then return the offset of its first occurrence in the matrix.
E.g. M(:,:,1) = [1 2 3; 4 5 6] M(:,:,2) = [10 20 30; 40 50 60]
Element is 50, then its offset = 10
Solution Stats
Problem Comments
-
1 Comment
Marco Castelli
on 9 Jan 2014
What do you mean whit the word "offset"?
Solution Comments
Show commentsProblem Recent Solvers42
Suggested Problems
-
Number of 1s in the Binary Representation of a Number
463 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2577 Solvers
-
401 Solvers
-
Return elements unique to either input
781 Solvers
-
Sum the elements in either diagonal of a square matrix
213 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!