changed scalemat.m subfunction