MATLAB: Do I receive a warning message when I copy a uibuttongroup that contains radio buttons and/or toggle buttons

MATLAB

When I run the following code in MATLAB:
h = uibuttongroup('pos', [0 0 .5 1]);
r = uicontrol('sty', 'rad', 'parent', h);
r1 = uicontrol('sty', 'rad', 'parent', h, 'pos', [20 60 60 20]);
set(r, 'Callback', 'disp 11111');
set(r1, 'Callback', 'disp 22222');
f2=figure;
copyobj(h, f2);
I receive the warning messages:
Warning: Callback for uicontrol of style radiobutton will be overwritten when added to a UIBUTTONGROUP.
Use the SelectionChangeFcn property on the button group instead.
> In uitools.uibuttongroup.childAddedCbk at 12
Warning: Callback for uicontrol of style radiobutton will be overwritten when added to a UIBUTTONGROUP.
Use the SelectionChangeFcn property on the button group instead.
> In uitools.uibuttongroup.childAddedCbk at 12

Best Answer

The warning appears to remind you to include code to control radio buttons and toggle buttons that are contained in a button group in the button group's SelectionChangeFcn callback, not in the radio button or toggle button Callback functions.
Related Question