I'm having an issue fitting a plane to a 3d data set using the cftool. I have lots of these data sets, and every once and a while, the plane fit it gives me is clearly way off, and I have no idea why.
Here is the piece of code I'm using, its pretty basic:
X = data(:,1); Y = data(:,2); Z = data(:,3); fitobject = fit( [ X, Y], Z, fittype('poly11')); Fitted_plane = [ fitobject.p00 , fitobject.p10 , fitobject.p01 ];
And to give you an idea of what the fit looks like:
And the fit is clearly not correct, but I cannot for the life of me figure out how to fix it. This happens for maybe 1/10 of the fits I'm doing, and I was wondering if maybe there is a problem with the toolbox? I can definitely send out the data set, I just didnt want to post the whole thing here.
Thanks in advance.
Best Answer