I am trying to fit an equation to the data, i am using polyfit but it is not close enough. I also dont have curve fitting toolbox. Here is the code and picture:
p2 = polyfit(xDat,zDat,2);
f2 = polyval(p2,xDat);
figure;
plot(xDat,zDat,'.r');
hold on
plot(xDat,f2,'*b');
Red dots is data and Blue points is the fit.