MATLAB: How to turn off the warning message when copying “uibuttongroup” objects in MATLAB 7.5 (R2007b)

MATLAB

I see some warnings printed on the command line while copying "uibuttongroup" objects.
Using the following command, I could set warnings off using MATLAB 7.0 (R14)
warning('off', 'UIBUTTONGROUP:CHILDADD');
The following code demonstrates this
h = uibuttongroup('visible','off','Position',[0 0 .2 1]);
u0 = uicontrol('Style','Radio','String','Option 1',...
'pos',[10 350 100 30],'parent',h,'HandleVisibility','off');
u1 = uicontrol('Style','Radio','String','Option 2',...
'pos',[10 250 100 30],'parent',h,'HandleVisibility','off');
u2 = uicontrol('Style','Radio','String','Option 3',...
'pos',[10 150 100 30],'parent',h,'HandleVisibility','off');
set(h,'Visible','on');
f=figure;
NewHandlesObjetsFig=copyobj(h,f);
This does not work anymore with MATLAB 7.5 (R2007b).

Best Answer

To turn of the warning you can execute the following line of code:
warning('off','MATLAB:childAddedCbk:CallbackWillBeOverwritten')
To determine the exact warning message, click on the warning message in the MATLAB command window. This takes you to the line of code that throws the warning message, you can then use the string in the warning message to turn the warning off.
These changes were made to standardize the way we display warning messages to make it easier for users to turn them off.