MATLAB code stops unexpectedly

2 views (last 30 days)
骐宇
骐宇 on 24 Aug 2025
Answered: Srikanth_Y on 1 Sep 2025
我使用的是罗技master 3s鼠标,不知道是不是在鼠标滚动过程中自动触发了一些终止运行的命令,请问要如何避免这种情况呢,如何禁用命令行输入以终止代码运行?
I'm using a Logitech Master 3s mouse. I'm wondering if some commands to terminate code are automatically triggered when I scroll. How can I avoid this? How can I disable command line input to terminate code execution?

Answers (1)

Srikanth_Y
Srikanth_Y on 1 Sep 2025
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:
while true
disp('Running...');
pause(1);
end
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

Categories

Find more on 编程实用工具 in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!