Matlab script edits