linearRegCosFunction.m modified