title: How to find the index value of the quartile values in an array using Matlab?
body: <p>I have a vector of dimension 1x3000. I have found the percentile value using the percentile function in Matlab. But I am unable to find the index value of the quartile inside the vector.  </p>
  
  <pre><code>y = rand(1,3000);
  Q_2 = prctile(y,50);
  Idx = find(y==Q_2);
  </code></pre>
  
  <p>Idx is returning an empty value. I should be able to get a value of the index containing the median value.</p>