user interface - How can I change the GUI controls' properties programatically in Matlab? -


as question title says, don't know how change programatically properties of different controls come matlab gui. let's have edit control, string property want modify. code write?

i researched both on-line , local help, didn't find satisfying.

here's small example:

h = uicontrol('style', 'edit', 'string', 'initial string'); %// create object set(h, 'string', 'changed string'); %// change object property 

(the second line part of object's callback function, causes first object's string change.)

as alternative, if don't have handle object, can assign object 'tag' (you can guide) , locate object tag using findobj:

uicontrol('style', 'edit', 'string', 'initial string', 'tag','e123'); %// or use guide set(findobj('tag', 'e123'), 'string', 'changed string'); 

Comments