Does Ctrl+C interrupt after executing all commands in a line?
이전 댓글 표시
Dear community,
I am running a loop where some state variables are updated.
Sometimes I want to interrupt that loop using Ctrl+C, but I want to make sure that all my state variables have been updated for consistency.
Currently I have created a structure that embeds all my state variables that I update writting:
state = state_past;
The intent is to update all the structure content at once, making it unafectable by a Ctrl+C interruption.
Q1: Do you think updating a whole structure is not interrupted by Ctrl+C?
Rather than using this state structure approach, I was thinking to write all my updates on the same line this way:
t = t_past; x = x_past; y = y_past; % and so on...
Q2: Do you think Ctrl+C can not interrupt in the middle of this line?
Q3: Is there a way to make sure a complete bloc of code is executed together not being interrupted by Ctrl+C?
Thank you for your enlightments.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!