This ability is not directly available in MATLAB.
As a workaround, you can save the data to a MAT file which can be loaded when the GUI is opened.
The attached files contain a basic example with a slider and an edit text box in the GUI. When the CloseRequestFcn is called on the GUI to end a session, values of the the editbox 'String' property and the slider 'Value' property will be saved to a MAT file. When the next GUI session is opened, the values will be loaded and used to set the GUI properties.
Please run the attached GUI by downloading the files to your MATLAB path and typing 'preference_saving_gui' at the MATLAB command prompt. After the GUI appears, make changes to the text box and slider control. Then close the GUI and notice that a MAT file has been created containing the saved property values. Rerun the file, and note that the old setting should be loaded. The command window will show messages indicating what has happened when opening and closing the GUI.
Please see the following functions in the attached GUI program file to understand how this GUI was implemented:
1) edit1_Callback
2) slider1_Callback
3) figure1_CloseRequestFcn
4) preference_saving_gui_OpeningFcn
Attached Files:
1) preference_saving_gui.m
2) preference_saving_gui.fig
Another example that also implements the similar behavior but in a slightly different manner:
1) reloading_param.fig
2) reloading_param.m