How to break a while loop similar to ctrl+C, but with code?

6 ビュー (過去 30 日間)
HutchNA
HutchNA 2018 年 2 月 21 日
To be a bit more specific, I have a servo motor performing a predetermined number of reciprocating motions. Sometimes however, I need to be able to abort these motions, but I want to do it using a button in the gui for my application (Like an emergency stop).
So my gui has a start button that will call my Start function to begin the motions and enter the while loop, and I want to create an abort button to break the loop, and stop execution of the Start function as if i had pressed ctrl+C. Any ideas on how to do this?

回答 (1 件)

Vishwanath Bailore Acharya
Vishwanath Bailore Acharya 2018 年 3 月 5 日
You can refer to below MATLAB Answer link which speaks about a similar scenario.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by