% P4
% Tests the function Best Plane

% Generate a roughly planar data set...
  randn('seed',0);
  m = 1000;
  lambda = 10;
  mu = -3;
  tau = 5;
  noiseFactor = 0.1;
  x = randn(m,1);
  y = randn(m,1);
  z = tau - mu*x - lambda*y + noiseFactor*randn(m,1);
  
  clc
  format long
  [a,phiMin] = BestPlane(x,y,z);
  a = a
  disp(' ')
  phiMin = phiMin