Is there two ways to write a code that gives you figure at opening?
Show older comments
When i work in gui and go to editor i get this kind of code (for example):
function radiobutton2_Callback(hObject, eventdata, handles)
and bellow of it i add what i want to do if this object is selected.But this code works too (just example):
h = uibuttongroup('Pos',[0 0 .2 1]);
u0 = uicontrol(h,'Style','Radio','String','Option 1',...
'pos',[10 350 100 30]);
u1 = uicontrol(h,'Style','Radio','String','Option 2',...
'pos',[10 250 100 30]);
u2 = uicontrol(h,'Style','Radio','String','Option 3',...
'pos',[10 150 100 30]);
set(h,'SelectedObject',u2); % Set the object.
The second code gives you figure at opening from editor too, but i don't know how.Any help?
Accepted Answer
More Answers (2)
jack int
on 18 May 2017
0 votes
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!