guidata
Gets or sets user defined data in the GUI.
Syntax
R = guidata(handle)
guidata(handle, data)
Inputs
- handle
- Handle of the object associated with the guidata, R.
- data
- User specified data. This will be stored in the handle, if handle is a figure. If handle is not a
Outputs
- data
- User specified data.
Examples
f = figure;
frh = uicontrol('style','frame','string', 'Frame','position',[0.02 0.1 0.5 0.4],'units','normalized');
txh = uicontrol('parent',frh,'style','text','string', 'Text','position',[0.1 0.2 0.5 0.1],'units','normalized');
guidata(txh, rand(2,3))
f = figure;
frh = uicontrol('style','frame','string', 'Frame','position',[0.02 0.1 0.5 0.4],'units','normalized');
txh = uicontrol('parent',frh,'style','text','string', 'Text','position',[0.1 0.2 0.5 0.1],'units','normalized');
guidata(txh, 'teststring')
guidata(txh)
ans = teststring