I experience the same issue, running MATLAB 2017A on macOS Sierra (10.12.5). Clearing the command line code (clc) does the trick in the short term.
To add to the depth of the issue, automated scrolling has also occurred in my script window, scrolling to a particular range of code lines even if I move the cursor or change the focus to another open script. For those in the same boat, closing and reopening the script was enough to fix it for now.
I'm sure this is a low priority bug, as it merely causes an inconvenience, but I sure hope it gets addressed soon!