matlab code edits