MATLAB: [GUI] How do you get only one element in a listbox guilistbox I know you are able to obtain all the elements in a string from the listbox with: get(handles.listbox1, 'String') But what if I only want the second or fourth element in the listbox? Thanks in advance <3 Best Answer You have to read in the whole thing anyway. Then get the value property and use that to index into the string.listboxItems = get(handles.listbox1, 'string');selectedItems = get(handles.listbox1, 'value');selectedItem = listboxItems(selectedItems); Related SolutionsMATLAB: How to change gui string newlabel = get(handles.editbox1, 'String');set(handles.checkbox1, 'String', newlabel); MATLAB: [GUI] Importing Data from an array of strings importer = importdata(listboxItems{a}); %note {} Related QuestionHow to reset toggle buttons with a push button[gui] how to load dataHelp me How to get the string from popup menu in matlab GUIRandom values by default? [GUI][GUI] Update variable in while loop[GUI] How do you fill a Listbox with documents from a specific folder
Best Answer