If you have some arbitrary function that you've fitted your data to, then you can write a separate function like so:
function y_pred = calcy(coeffs,xvals)
%%//coeffs is a vector of the fitted coefficients, x is a vector
%%//Calculate the predicted values here using whatever model you're using and the fitted
%%//coefficients and x-values
end
In your main function you'll call:
y_pred = calcy(coeffs,xvals);
dlmwrite('file.txt',y_pred);
This will write the vector in comma-delimited format to your directory. You can look at documentation of dlmwrite for how to change the format to suit your needs.