title: How to overlay a surf plot with a 2D matrix in matlab?
body: <p>I have a 3D matrix (300x178x125) describing the X,Y,Z positions of a glacier, which is plotted with the slice command:</p>
  <pre><code>clear all
  load('glacier.mat')
  load('realx.mat')
  load('realy.mat')
  load('realz.mat')
  load('h_deb.mat')
  glacier = double(squeeze(glacier));
  glacier(glacier==0)=nan;                 
  h = slice(realx,realy,realz,glacier, [], [], 1:size(glacier,1));
  set(h, 'EdgeColor','none', 'FaceColor','interp', 'FaceLighting','gouraud')
  colorbar;
  daspect([0.5 1 0.1])
  view(-142,31)
  set(gcf, 'color', 'white')
  </code></pre>
  <p>which then looks like this:</p>
  <p><a href="https://i.stack.imgur.com/fnpWhl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fnpWhl.png" alt="enter image description here" /></a></p>
  <p>I now want to overlay a 2D matrix (300x178) on the surface of the glacier. Thus, I want to apply the color mapping of the 2D image to the glacier surface:</p>
  <p><a href="https://i.stack.imgur.com/rGZAGl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rGZAGl.png" alt="enter image description here" /></a></p>
  <p>How can I do this?</p>