Hello everyone,
I'm creating an app with matlab appdesigner, to dynamicly adjust some parameters in a running function. I want to design a slidebar such that I could adjust variables while the function is running, so that I could monitor the performance of the function in real time. Is there any way to achieve that?
Look forward to your help.

댓글 수: 1

Jin Ren
Jin Ren 2021년 2월 5일
@KSSV sorry I'm new to asking question, I just deleted the previous problem. Please refer to this new one.

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

 채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 5일

0 개 추천

If the function does not call pause or drawnow or uiwait or figure, then you need to go into the editor and trick it to open the file (which is sometimes only possible if it happens to be in the recent list or you happen to have the folder view open.) Once it is open, right click at the appropriate place to insert a breakpoint at a line and wait for execution to stop; then you can use the command line to change the value and then dbcont to continue.
In some cases you might need to resort to injecting a dbstopfor a lline tthat has a condition aattached to it, except that you make the condition be a call to a function that alters the variable as a side effect using assignin caller, and then returns false so that the debugger thinks the condition was not matched and continues execution.
Mostly though you should not do this, and should instead arrange to share a variable and have some gui that changes the variable value, with the loop checking for changes periodically.

댓글 수: 1

Jin Ren
Jin Ren 2021년 2월 5일
Actually what I want to do is exactly your last paragraph, and I just find that matlab works well with this. Thank you so much!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 2월 5일

댓글:

2021년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by