function disableRadioButton % Create a figure window: a=uifigure("Position",[180,550,200,600]); text='Path %d'; uilabel(a,"Text","D","Position",[10,580,20,20]); uilabel(a,"Text","P","Position",[30,580,20,20]); uilabel(a,"Text","S","Position",[50,580,20,20]); P=[]; D=[]; S=[]; for w=1:20 l=sprintf(text,w); D=[D,uicheckbox(a,"Text","","Position",[10 580-20*w 20 20], ... "ValueChangedFcn",{@DisplayCB,w})]; P=[P,uicheckbox(a,"Text","","Position",[30 580-20*w 20 20])];% you can alter the position S=[S,uicheckbox(a,"Text",l,"Position",[50 580-20*w 60 20])];% you can alter the position end end function DisplayCB(app,event,idx) display(event.Value) end