Inserting data to listbox

6 visualizzazioni (ultimi 30 giorni)
R Hebi
R Hebi il 24 Nov 2019
Modificato: R Hebi il 7 Mar 2020
I am using MATLAB guide,
I have import a data (chemical elements Name) from Excel to a listbox (popupmenu1). Now I have created an editext box (edit10), When the user wish to add a new data(new element), he/she will write the data on the edit text box (edit10) then push (pushbutton4). Then GUI will save the new data on the same list box (popupmenu1)

Risposta accettata

Image Analyst
Image Analyst il 24 Nov 2019
Try this in the callback function of the pushbutton:
listboxItems = handles.popupmenu1.String; % Get existing list from the popup
listboxItems{end+1} = handles.edit10.String; % Append edit field 10.
% Put new list back in the popup:
handles.popupmenu1.String = listboxItems;
You can sort it if you want with sort().

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by