title: How to use Matlab to draw these 3D shapes?
body: <p>I am trying to use Matlab to create these 3D shapes for illustration purpose (Please see the image below). I think surf is the function I should use; however, haven't got a clue what are the functions I should use to represent these shapes. Anyone can suggest an example please? Thanks.</p>
  
  <p><img src="https://i.stack.imgur.com/V89mD.png" alt="enter image description here"></p>
  
  <p>A. </p>
  
  <p>Edit 1:</p>
  
  <p>Thanks for the replies from Trogdor and PetrH.</p>
  
  <p>Currently, I am trying to plot a shape that is more sharp. For example, z = x.^2 + y.^2; can plot a normal cup shape. However, I want to plot something like the subplot on the right hand side shown below. Tried several different function but not working. Thanks for any tips!</p>
  
  <p><img src="https://i.stack.imgur.com/84RBF.png" alt="enter image description here"></p>
  
  <p>Edit 2:</p>
  
  <p>Use z = x.^2 -4*x+ y.^2-4*y; can make the shape more flat. Still haven't got a method to make it sharp.</p>
  
  <p><img src="https://i.stack.imgur.com/zPHNH.png" alt="enter image description here"></p>