Enabling a slider panel in a multi variable checkbox
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
I am trying to implementing a multi varible checkbox with around 350+ variables. But, the displayed figure does not have a slider in it. Could you please help me out?
function checkbox()
handles.fig = figure;
handles.cbh = zeros(5,1);
handles.label = varNames.'; 
    for k = 1:numel(varNames)
        handles.cbh(k) = uicontrol('Style','checkbox','String',handles.label(k), ...
            'Value',0,'Position',[30 20*k 130 20],        ...
            'Parent', handles.fig, ...
            'Callback',{@checkBoxCallback,k});
    end
guidata(handles.fig,handles);
    function checkBoxCallback(hObject,~,checkBoxId) % this will be edited later for plotting based on the input
        handles = guidata(hObject);
        value = get(hObject,'Value');
        if value
            switch checkBoxId 
                case 1
                    fprintf('handle cb 1\n');
                case 2
                    fprintf('handle cb 2\n');
                otherwise
                    fprintf('do nothing\n');
            end
        end
    end
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
			
	제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
