I want to fit a 3D line with known equation (F(x,y)) to a set of points (x,y,z), to find the parameters of the equation. Therefore, I need to solve: min||F(ydata,xdata)−zdata||. How can I implement this in Matlab? do you know any similar or substitute approach?