procced the for loop until UIButton pushed

9 ビュー (過去 30 日間)
TheDice
TheDice 2021 年 4 月 16 日
編集済み: Aghamarsh Varanasi 2021 年 4 月 19 日
Hi all, I want to wait in my For loop until a UI button has been pressed. Is there a function for this?
for v = 1:10
MeasurementStart(app,v)
AxesValue(app,v)
pause(5)
% do not proceed until the button is pressed
end

回答 (1 件)

Aghamarsh Varanasi
Aghamarsh Varanasi 2021 年 4 月 19 日
編集済み: Aghamarsh Varanasi 2021 年 4 月 19 日
Hi,
You can use the uiwait function to pause the execution and wait for the button click. You can refer to uiwait documentation page for more details. You also need to register the 'ButtonPush' callback for the button inorder to call the uiresume function.
Hope this helps

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by