title: Plot 3D points in Matlab
body: <p>I want to plot 3D points in <code>Matlab</code> in different colors depending on a value. I've got following code, but this does not work because <code>plot3d</code> needs a vector.</p>
  
  <pre><code>x = vdhf_data.data(:,1);
  y = vdhf_data.data(:,2);
  z = vdhf_data.data(:,3);
  data = vdhf_data.data(:,4);
  
  grid on
  hold all
  
  for k=1:length(x)
      if data(k) &lt; 6  
          plot3d(x(k), y(k), z(k), 'ws--', 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'r')
      else
          plot3d(x(k), y(k), z(k), 'ws--', 'MarkerEdgeColor', 'g', 'MarkerFaceColor', 'g')
      end
  end
  </code></pre>
  
  <p>How to do that in Matlab?</p>