title: Calculate quantile for a whole matrix
body: <p>For the working purposes, I need to find the overall quantile cut points for a matrix. I know I can "unlist" or "break" the matrix into two dimensional column and R can easily apply "quantile" function for a vector. </p>
  
  <p>However, once I unlist the matrix and calculate the quantile, I don't know how to recover the unlisted data to the original one. Can someone tell me a method that can achieve this? Or are there some alternative ways to achieve my purpose?</p>