There is only a single regressor and a response variable so despite the comment in the code, this is NOT multiple regression (well, ok, technically it is but for the degenerate case of Nregressors==1).
The above code is identically(*) the same in result as would be
bQTc2 = polyfit(AFall(4,:)',AFall(1,:)',1); % fit QTc=bQTc2(1)*RR + bQTc2(2) <--> y=mx+b
%plot linear regression response against RR
scatter(AFall(4,:), polyval(bQTc2,AFall(4,:)),'xr') % put QTc_hat on plot as well...
All regress is doing is solving for the same coefficients of slope, interecept using a more general routine to do so but there's no data for more coefficients. polyfit supplies the needed column of ones to solve for the intercept term automagically whereas in regress, being a general routine, you have to supply the variables including the intercept term explicitly.
See
doc regress
doc polyfit
for details.
One can only presume that since there are at least four variables (rows) in the original array that possibly the original code did, in fact, try to regress the dependent variable on more than just the one variable; hence the comments and use of regress. It would appear that if so, the results weren't promising enough to have kept and the developer just pruned the additional variable(s) from the fitting expression and didn't modify the comments to match.
() Identical excepting the order of the coefficients is reversed; |*polyfit| returns coefficients for
p(x)=p(1)*x^n + p(2)*x^(n−1) + ... + p(n)*x + p(n+1)
whereas the model matrix as written above for regress has the column of ones for the intercept first so that will be the first coefficient returned; iow, the order of bQTc2 values is reversed between the two formulations. That is taken care of as I wrote it as polyval is written as the boon companion of its brother and expects the coefficient array in the above order. NB: the explicit evaluation expression the original author wrote is reversed sense in keeping with the model as specified.
