title: How can I calculate and plot a plane that is perpendicular to a known vector and passes through a known point?
body: <p>I want to plot the plane perpendicular to a vector, and going through a point with Matlab.
  My vector has coordinates <code>v1 = [2,i]</code> and my point has coordinates <code>com_m1 = [1,i]</code>.</p>
  
  <p>I have tried both:</p>
  
  <pre><code>xx=(-15:-6:0.25);
  yy=(-10:-2:0.25);
  for i = 1:length(xx)
      for j = 1:length(yy)
              zz_m1(j,i)=(v1(2,2)*(xx(i) - com1(1,1)) + v1(2,2)*(yy(j)-com1(1,2)))/v1(2,3) + com1(1,3);
      end
  end
  surf(xx,yy,zz_m1, 'FaceColor','red','EdgeColor','none') % Plotting the surface
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[xx, yy]=meshgrid(-15:-6:0.25,-10:-1:0.25);
  zz_m1=(v1(2,2)*(xx - com1(1,1)) + v1(2,2)*(yy-com1(1,2)))/v1(2,3) + com1(1,3);
  surf(xx,yy,zz_m1, 'FaceColor','red','EdgeColor','none')
  </code></pre>
  
  <p>But both didn't work. Can anyone help me understand what I am doing wrong?
  Thanks!</p>