title: How to find the index of last element which is non-zero in array
body: <p>I have a vector <code>d</code> that its size <code>1x1000</code>. It stores a random values from <code>0</code> to <code>1</code>. For example</p>
  
  <pre><code>d=[0.0076 0.4629 0.1554...0 0 0 0 ...0.0442 0 0 0 10^-7 10^-7 10^-7] 
  </code></pre>
  
  <p>Now, I want to get the index of element at the last of vector (has maximize index) subject to <code>non-zero</code> or bigger than <code>10^-7</code>). For my example, the element that has value is <strong>0.0442</strong> and <code>index=</code>?. How to implement it by MATLAB? Thank all</p>