Hey guys, reading polyfit's help i wander how to calculate r-squared (coefficient of determination). Could u pls exemplify in a simple linear fit? Thx!

or corr(q, y) to find the correlation between the fitted and original values.