Update weight.m