MATLAB: Obtaining the variance-covariance matrix

MATLABmatricesmatrix

i wanted to ask if by doing the result will be equal to E as in the equation shown

Best Answer

That appears to me to be the covariance matrix of the parameters of the linear regression, so in a word, No. The cov function will not do what you want in that situation.
If you have the Statistics and Machine Learning Toolbox, use the LinearModel (specifically: fitlm) to return the CoefficientCovariance matrix for you. It will also do all the necessary calculations to estimate the confidence intervals on the parameters, so there is no need for you to code them separately.