I\'m looking to fit a plane to a set of ~ 6-10k 3D points. I\'m looking to do this as fast as possible, and accuracy is not the highest concern (frankly the plane can be off
It looks like griddata might be what you want. The link has an example in it.
If this doesn't work, maybe check out gridfit on the MATLAB File Exchange. It's made to match a more general case than griddata.
You probably don't want to be rolling your own surface fitting, as there's several well-documented tools out there.
Take the example from griddata:
x = % some values
y = % some values
z = % function values to fit to
ti = % this range should probably be greater than or equal to your x,y test values
[xq,yq] = meshgrid(ti,ti);
zq = griddata(x,y,z,xq,yq,'linear'); % NOTE: linear will fit to a plane!
Plot the gridded data along with the scattered data.
mesh(xq,yq,zq), hold
plot3(x,y,z,'o'), hold off