Good afternoon,
I´m having a problem with waitfor.
I have a gui with several checkboxes and I want to wait until a checkbox is selected. I have tried:
waitfor(findobj(gcf,'Style','checkbox'),'Value',1)
I have also tried:
waitfor(gcf,'Style','checkbox','Value',1)
But nothing works. So, can someone tell me something about this please Thanks
Silvia

답변 (2개)

Image Analyst
Image Analyst 2017년 11월 16일

0 개 추천

You don't need to use waitfor(). Your GUI is already waiting for any kind of user interaction. All you have to do is to put the code you want to run when the user clicks on the checkbox into the callback/click function for that checkbox.

댓글 수: 1

Gregor Isack
Gregor Isack 2017년 11월 23일
편집: Gregor Isack 2017년 11월 23일
Hey, I see you quite active in image processing field and have a vast knowledge in this field, I wonder would you have a look at the post I posted at StackExchange, so far it didn't has any answer yet. Maybe you could give me some opinions/methods that I'm currently unaware of as I'm new to this field. Thanks a bunch!

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

Walter Roberson
Walter Roberson 2017년 11월 16일

0 개 추천

I suggest that instead you use uiwait() on the figure after having set the Callback for each of the checkboxes to call uiresume() if their Value is 1.

댓글 수: 1

Silvia Ruiz
Silvia Ruiz 2017년 11월 17일
Thank you, I solved the problem using waitforbuttonpress and verifying if one of the checkboxes is selected. But I'll also try with uiwait. Thanks again.

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

카테고리

질문:

2017년 11월 16일

편집:

2017년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by