MATLAB: Curve fitting for non-linear data

curve fittinglsqcurvefit

I am trying to fit some data using lsqcurvefit in MATLAB but I am fairly new to this area.
xdata1 = [0 60 660 1250];
ydata1 = [0 18 23 31];
In the image below, the red line is the fit I want to achieve. Sadly, Polyfit does not provide suitable results.
How can I achieve this fit? Thank you in advance!

Best Answer

I believe piece-wise linear fitting was in the scope of Bruno's free-knot spline fitting package,