MATLAB: How to pass an argument in a CreateFnc in a GUI

createfcnguide

I want to pass an argument in a GUI's create function. The GUI opening function though is executed "after" the creating on the GUI. So, how do I pass an argument in a create function?
I want to create a drop down menu and the number of options is not constant, it depends on previous processing.

Best Answer

You don't. You do stuff in the OutputFcn(), not the CreateFcn(). OutputFcn is executed after the OpeningFcn. You can use global, or setappdata/getappdata(), or other ways described in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F