title: How to plot a 3-column matrix as a color map in MATLAB?
body: <p>I have a matrix containing the temperature value for a set of GPS coordinates. So my matrix looks like this : </p>
  
  <pre><code>Longitude  Latitude  Value
  ---------  --------  -----
  12.345678  23.456789   25 
  12.345679  23.456790   26
  %should be :
  %  x           y        z
  </code></pre>
  
  <p>etc.</p>
  
  <p>I want to convert this matrix into a human-viewable plot like a color plot (2D or 3D), how can I do this?</p>
  
  <p>3D can be something like this : 
  <img src="https://i.stack.imgur.com/jiYoj.png" alt="enter image description here"></p>
  
  <p>or just the 2-D version of this (looking from top z-axis).</p>
  
  <h2>What Have I Tried</h2>
  
  <p>I know MATLAB has <code>surf</code> and <code>mesh</code> functions but I cannot figure out how to use them.</p>
  
  <p>If I call </p>
  
  <pre><code>surf(matrix(:,1) , matrix(:,2) , matrix(:,3));
  </code></pre>
  
  <p>I get the error :</p>
  
  <pre><code>Error using surf (line 75)
  Z must be a matrix, not a scalar or vector
  </code></pre>
  
  <p>Thanks in advance for any help !</p>
  
  <p><strong>P.S :</strong> It would also be great if there is a function that "fills" the gaps by interpolation (smoothing, whatever :) ). Since I have discrete data, it would be more beautiful to represent it as a continous function.</p>
  
  <p><strong>P.S 2 :</strong> I also want to use <a href="http://www.mathworks.com/matlabcentral/fileexchange/27627-plotgooglemap" rel="nofollow noreferrer">plot_google_map</a> in the z=0 plane. </p>