Arn, This bug only affects those who have multiple screens on their computer. So it really will not affect very many people and it will not affect anyone using lab computers. The problem is that the line ‘monitor = get(0,'MonitorPosition'); ‘ returns a matrix instead of a vector. When there are multiple screens, there are multiple rows in the matrix. The code accesses a specific element of the matrix. When there are multiple screens, a random element is selected. I added 2 lines of code and changed the variable name in the line calculating the position. See the code below for the changes. This is a quick fix and will only work correctly on the main screen and not on any other monitors on the system. Since students only use this part of the code for a couple of minutes and then move on, it may be adequate. Of course I didn’t test it to see if it will work with only 1 monitor. I may have caused even more problems. % % Controller % Control signal: theta, beam angle (rad) % Useful variables: xball, ball position (m) % vball, ball velocity (m/s) % t, time (s) % switch mode; case 1; monitor = get(0,'MonitorPosition'); % get monitor size rotatedMatrix = rot90(monitor,3); % rotate the monitor matrix 270 degrees flipMatrix = fliplr(rotatedMatrix); % flip the monitor matrix left to right % The data from the monitor % matrix can now be used % when there are multiple % monitors on a system. % However, it will only % work on the primary % monitor. Additional % logic will be required to % identify if the figure is % on a different screen and % to scale the mouse for % that screen cursor = get(0,'PointerLocation'); % get mouse pointer position on monitor sensitivity=5; % set sensitivity to mouse movement position=sensitivity*((cursor(1)-1)/((flipMatrix(3))-1)-0.5); % scale theta=gmanual*position; % manual control case 2;bbeamc; % automatic control end; Steven Olsen