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
Solution Comments
Show comments
Loading...
Problem Recent Solvers44
Suggested Problems
-
Remove the small words from a list of words.
1566 Solvers
-
384 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1329 Solvers
-
convert matrix to single column
440 Solvers
-
Sum of odd numbers in a matrix
622 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!
What do you mean whit the word "offset"?