Optimizations on mclr cost

Used cell2mat for matrix creation and deleted
Small improvement in efficiency by taking the X multiplication out of the loop