fixed bug in matlab processing script