see below:
function logNames
% Create UI figure and components
fig = uifigure('Position',[100 100 410 400]);
loglist = uitextarea(fig,...
'Position',[134 49 150 277],...
'Editable','off');
namefld = uieditfield(fig,'text',...
'Value', 'Bob Langley',...
'Position',[134 367 100 22],...
'ValueChangedFcn',@(namefld,event) nValChanged(namefld,event,loglist));
end
% Create ValueChangedFcn callback
function nValChanged(namefld,event,loglist)
newvalue = event.Value;
previousValue = event.PreviousValue;
loglist.Value = [previousValue; loglist.Value];
end
Morteza Hajitabar Firuzjaei