필터 지우기
필터 지우기

How to break a running function in an App Designer app?

조회 수: 6 (최근 30일)
qmnjb007
qmnjb007 2018년 1월 14일
편집: Matt J 2018년 1월 16일
I have a button in app designer that calls a function, which can sometimes take 15+ min to return. I'd like to have a second button which breaks the function call of the first so that I can change other UI elements and start the call over. What's the best way to do this?

답변 (1개)

Matt J
Matt J 2018년 1월 15일
편집: Matt J 2018년 1월 15일
Ctrl+C should abort the function call without aborting the app.
If that's not graceful enough, you will need to modify whatever loop button #1 is running so that it periodically check the state of some app property controlled by button #2.
  댓글 수: 6
qmnjb007
qmnjb007 2018년 1월 16일
Matt, when you say "pass app" as an argument, what do you mean?
Matt J
Matt J 2018년 1월 16일
편집: Matt J 2018년 1월 16일
I mean, pass the variable called "app" to sim_year as an optional 5th argument,
x = sim_year(app.in_it, slr_cur, batt_cur, app.b_chrg, app);
That way, sim_year will have access to everything that app does.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop 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