at the moment it only works for the fist button. can you help me please.
i know its something to do with the creating of the button. in the for loop
clear all, clc, close all
fh = figure;
n = 3;
x = ceil(rand(10)*2);
y = ceil(rand(10)*2);
bgh = uibuttongroup('Parent',fh,'Title',...
'Button Game','Position',[.1 .2 .8 .6]);
for i = 1:n
rbh1 = uicontrol(bgh,'Style','Pushbutton','String','Red',...
'Units','normalized','Position',[rand(1) rand(1) x(1,i) y(1,i)]);
set(rbh1,'CallBack','set(rbh1,''visible'',''off'')')
end
axt = axes('Parent',bgh,'Units','normalized');
axis([0.5 1 0.5 1])
axis square
axis off

New Topic/Question
Reply



MultiQuote


|