Mousetracking code in Matlab