필터 지우기
필터 지우기

Issue with push button userdata

조회 수: 7 (최근 30일)
Jason
Jason 2019년 9월 27일
댓글: Himanshu Jain 2021년 8월 24일
Hello.
I am trying to enable a push button to exit a loop if its pressed and decided to user the buttons "UserData".
So I initially set it to 0.
set(handles.btnStop, 'userdata',0)
in my loop, i then check the status of this with an if statement
if get(handles.btnStop, 'userdata') % stop condition
break;
end
In a stop push button I set the user data to 1
set(handles.btnStop, 'userdata',1)
But Im getting a strange result.
when I check what the userdata is berfore I go into the loop (via set(handles.btnStop, 'userdata',0)), I see its a cell array with 2 elements:
ans =
2×1 cell array
{[0]}
{[0]}
  댓글 수: 1
Himanshu Jain
Himanshu Jain 2021년 8월 24일
I am not able to reproduce the same issue, I am getting the expected results. Can you please send more info about the issue. Also if possible, please share the code in which this issue is occuring.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by