Matlba code