How to find checkboxes in panel component in MATLAB app designer?
조회 수: 12 (최근 30일)
이전 댓글 표시
% Find all the checkbox objects belonging to features
checkboxes = findobj(app.features, 'Style', 'checkbox');
In this code I'm trying to find all checkboxes that are in the panel "app.features". I don't get an error message, but I can't find any objects either. I get an 0x0 GraphicsPlaceholder. I only want to find the checkboxes that are in this panel, not in the whole app. How do I do this?
I attached the app, the section I'm talking about is in callbackfunction btnDrawButtonPushed(app, event).
댓글 수: 0
채택된 답변
Cris LaPierre
2023년 1월 28일
Try this instead
checkboxes = findall(app.features,'type','uicheckbox');
댓글 수: 2
Cris LaPierre
2023년 1월 28일
As the message states, there is no String property for checkboxes. The checkbox properties documentation page contains a list of all the properties of a checkbox. There, you will see the property name is 'Text' instead of 'String'.
Try this instead.
selected_names{end+1} = checkboxes(i).Text;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!