Requirements Write a functionto do multi linear regression, [a, r2] = MultiLinearRegress(X, y), that:a.Takes as inputa matrix X where each column X(:,i)contains the data forindependent variable xi and a column vector y containing the data for thedependent variable.b.Checks that size(X,1)is equal to size(y,1)and returns an appropriate errorif this is not the case.c.Performs multiple linear regression by constructing an appropriate coefficientmatrix A and right?hand?side vector b and then solving for the unknowncoefficients a (see course notes on multiple linear regression or Section17.3 of textbookfor details on the form of thecoefficient matrix and right?hand?side vector).d.Calculates the coefficient of determination, r2, as