Clear Filters
Clear Filters

Changing number of buttons

2 views (last 30 days)
Teresa
Teresa on 20 Jul 2011
I've implemented a Gui with Guide where i can choose a mat-File. Then the data is shown in an image-plot with a variable number of xTickLabels and yTickLabels. Now i want this TickLabels as buttons or a button next to every TickLabel. Is it possible to create the buttons when the data is loading? And how could i place the buttons beside or under the TickLabels? I hope my problem is clear and I'm happy about every answer

Accepted Answer

Paulo Silva
Paulo Silva on 20 Jul 2011
Something similar to this
figure
for n=1:9
b{n}=uicontrol('Style','PushButton','Units','Normalized',...
'String',['P' num2str(n)],'Position',[.1*n .1 .1 .1],...
'Callback',@(obj,event)msgbox(num2str(n),num2str(n)));
end

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!