function myButtonRandColor()
%% function generating GUI and defines callback function
hFig = uifigure('Position',200*ones(1, 4), ...
   'Resize', false);
hLabel = uilabel(hFig, 'Text', 'yellow', ...
   'Position', [0 150 200 25], ...
   'HorizontalAlignment', 'center');
hButt = uibutton(hFig, 'Text', 'my button', ...
   'Position', [50, 50, 100, 25], ...
   'BackgroundColor', 'y');
hButt.ButtonPushedFcn = @(src, event)changeColor(hButt, hLabel);
end
function changeColor(hButt, hLabel)
Color = rand(1,3);
hButt.BackgroundColor = Color;
hLabel.Text = sprintf('[R:%0.4f, G:%0.4f,B:%0.4f]', Color);
end