MATLAB: Using Push Button to Export a String to an Edit Textbox (GUI)

arrayboxbuttoncelldisplayeditexportgetappdataguiMATLABmatlab guipushpushbuttonsetappdatasprintfstringtext;textbox;using

Hello all, as simply as possible, how would you export a string to an Edit Textbox so it can be displayed when the GUI is run?
Would you use a combination of setappdata, getappdata, sprintf()? I'm new to GUI and would really like a good universal "recipe" or method that can be easily adapted for other similar purposes (say, export cell arrays from a listbox to an axes1 graph, etc.).
For example, my string is "Name" here below in my Push Button Callback function :
function pushbutton4_Callback(hObject, eventdata, handles)
Name = 'Thomas';
setappdata(handles.figure1, 'Name', Name); %Storing my string "Name" in my UI figure1.
And I would like to export this name and display it into my Edit Textbox (Callback function here) :
function edit1_Callback(hObject, eventdata, handles)
Name = getappdata(handles.figure1 , 'Name'); %Retrieving my string "Name"
set(handles.edit1,'String', Name); % Displaying my string "Name" into my Edit Textbox.
I'm probably getting this all wrong. I'm not sure what to use to display my string "Name". It should look like this button on the right and the Edit textbox on the left :
PLPL.png
Thanks for the support!

Best Answer

set(handles.edit1,'String', Name); % Displaying my string "Name" into my Edit Textbox.
Put this line in your pushbutton4_Callback fuction