MATLAB: How to display data from editext in listbox in GUI

dictionarydisplay data in listboxedittextgui matlablistbox

Hi everyone!
My problem is:
I have a GUI contains a listbox and a edittext.
Listbox have a array of strings:
a
an
able
back
bath
bench
car
create
common
claim
dad
did
dear
eat
edit
english
enable
far
father
fish
jacket
jet
kiss
gather
get
gun
...
and so on
Now, i want to import a word "jacket" (for example) on edittext. i expect when i import word "j" on edittext, the listbox will display all word that begin with word "j". Similarly, when i import consecutive word, "a", (now, i'm having "ja" on edittext). the listbox will display all word that contains words "ja". and so on
Thank you so much

Best Answer

the contains() function can help you out here, or if you want to get fancy, regexp()
Set your callback for the 'edit' box to retrieve the strings from the list box,
and do
contains(list_box_string,edit_box_string)
This will give you a logical array, simply use that array as indexing for the strings in the listbox.
Note: You may want to save the main list under a variable to be called when edit box is empty, so that you preserve it and it doesnt get lost when you change the string of the listbox.
Let me know if this helps or if you need more clarification.