title: How to generate a 2D random vector in MATLAB?
body: <p>I have a non-negative function <code>f</code> defined on a unit square <code>S = [0,1] x [0,1]</code> such that 
  <a href="https://i.stack.imgur.com/Uq0ZU.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uq0ZU.gif" alt="enter image description here"></a></p>
  
  <p>My question is, how can I use MATLAB to generate a 2D random vector from <code>S</code> according to the probability density function <code>f</code>?</p>