how to run a while loop until esc is pressed?
8 次查看(过去 30 天)
显示 更早的评论
I need to run a loop that reads data off a serial port until i want to break it. i am using: {while true out = fscanf(obj); data_vec = sscanf(out,formatSpec, [1,130]); [w_vec,acc_vec] = IMU_DATA(data_vec); W = [W,w_vec]; ACC = [ACC,acc_vec]; end} I was wondering how can i use a callback function to stop the loop when i hit the esc key, without using ctrl +C?
0 个评论
采纳的回答
Jos (10584)
2017-10-23
I, the author of stoploop, suggest the function STOPLOOP: https://uk.mathworks.com/matlabcentral/fileexchange/20455
;)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!