You might try something like this:
Originally Posted by metafolic
But I have not checked this as I don't have Matlab or Octave on this machine.
% x*y' is the inner product or dot product of x and y
p=p-cc; %translate everything so plane goes through origin
u1=v1/sqrt(v1*v1'); %gramm-schmitt orthogonalisation of v1 and v2
dd=p-(p*u1')*u1-(p*u2')*u2; %get component of p normal to the u1, u2 plane
dist=sqrt(dd*dd'); distance of p from the plane