Note that the poly_fast functions do not implement the alternate scale-and-shift syntax - [p,S,mu] = polyfit(x,y,n). You'll have to do that yourself.