MATLAB: Automatically change the string of a uicontrol (a popupmenu)

guipopupmenuuicontrol

This is my question :
I have a variable (call Scenario) where I have a struct, and more specific a struct of name (come from an folder, anyway).
My question is : Can I automatically put this struct of name in the string of my popupmenu when I create the uicontrol ?
Thanks.

Best Answer

set(HandleOfControl, 'String', {StructureName.FieldName})
For example,
fileinfo = dir('*.jpg');
set(H, 'String', {fileinfo.name});