Hi 骐宇 王,
I understand how annoying it can be when the code stops unexpectedly, especially when just scrolling. Since you are using the Logitech MX Master 3S and working in the MATLAB terminal, here are a few things that might help:
- Check Mouse Settings: Open Logi Options+ and look at the button and gesture mappings. Make sure none of them are set to “Ctrl+C”, which is the shortcut MATLAB uses to interrupt code.
- Test in MATLAB: Try running a simple loop like:
Then scroll with your mouse. If the loop stops, it’s likely a mouse input is triggering an interrupt.
- Adjust Scroll Behaviour: In Logi Options+, disable SmartShift and avoid assigning scroll actions to any keyboard shortcuts.
Hope this helps