title: Calculating and plotting differences between two point clouds
body: <p>I have two point clouds (XYZ coordinates) of different dimensions and would like to be able to calculate the difference between them (with the result as an XYZ array, with Z being the distance between them) and then plot both as surfaces together with the differences as a different color.  </p>
  
  <p>This question seems relevant, but is not quite what I am looking for: <a href="https://stackoverflow.com/questions/3955711/subtract-two-trisurf-plots-from-one-another">Subtract two trisurf plots from one another</a></p>
  
  <p>Here is some example data and code. I can't figure out how to interpolate one dataset to another. </p>
  
  <pre><code>%Point Cloud 1
  X1 = randn(100,1);
  Y1 = randn(100,1);
  Z1 =(exp(-X1.^2-Y1.^2));
  % Point Cloud 2
  X2 = randn(107,1);
  Y2 = randn(107,1);
  Z2 = (exp(-X2.^2-Y2.^2));
  
  tri1 = delaunay(X1, Y1);
  tri2 = delaunay(X2, Y2);
  
  trisurf(tri1, X1, Y1, Z1, 1)
  hold on
  trisurf(tri2, X2, Y2, Z2, 100)
  hold off
  </code></pre>
  
  <p>The question I mentioned above directs to here: <a href="https://stackoverflow.com/questions/1672176/how-do-i-generate-a-3-d-surface-from-isolines">How Do I Generate a 3-D Surface From Isolines?</a> but I am new to interpolation of 3d data in Matlab and can't seem to figure it out. Any help would be appreciated. Thanks.</p>