title: Find the Start Index and End Index of the same Element in a Matrix in Matlab
body: <p>I want to get the start index and end Index of the same repetitive Element in a matrix?
  for example this Matrix:</p>
  
  <p><img src="https://i.stack.imgur.com/eFtsk.png" alt="Matrix"></p>
  
  <p>the result will be:</p>
  
  <p><img src="https://i.stack.imgur.com/FMo9l.png" alt="Result"></p>
  
  <p>zero is not considered</p>