MATLAB Answers

Button for choose language-guide

1 view (last 30 days)
john
john on 12 Mar 2012
Hi,
how can I define any flag (picture) to bushbutton or how to put any picture for example to the pushbutton?
Thank you

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 13 Mar 2012
H2pushbutton = ... from somewhere where you create the pushbutton you get and keep the handle.
% To set the picture:
set(H2pushbutton,'cdata',yourimage)
HTH
  3 Comments
Bjorn Gustavsson
Bjorn Gustavsson on 13 Mar 2012
H2thisthatorthenext is just a simple mnemonic for "handle to this that or the next". For future ease of code maintenance make good use of descriptive variable names, in my experience it doesn't really matter if you mix different styles a bit (_ as a word separator, camel-case etc) but it really helps to have names that are descriptive in some explicit way.

Sign in to comment.

More Answers (1)

Jan
Jan on 12 Mar 2012
You can set the 'CData' property of the uicontrol:
rgb = rand(10, 20, 3);
a = uicontrol('cdata', rgb);
  3 Comments
john
john on 13 Mar 2012
hi,
1. insert picture into pushbutton...if it is not possible, then
2. insert picture into guide

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!