Editable Popup

Copyright 2017-2019 The MathWorks Inc.

Create the widget

f = figure(...
'Toolbar','none',...
'MenuBar','none',...
'NumberTitle','off',...
'Units','pixels',...
'Position',[100 100 320 45]);
movegui(f,[100 -100])
w = uiw.widget.EditableTextWithHistory(...
'Parent',f,...
'FieldType','number',...
'Value',5,...
'Callback',@(h,e)disp(e),...
'Label','Edit box:',...
'LabelLocation','left',...
'LabelWidth',90,...
'Units','pixels',...
'Position',[10 10 300 25]);

Set the value to freeform text

w.Value = 5;

Set to a value in the list by Value

w.Value = 6;