How do display the contents of array in Listbox using app designer ???

조회 수: 13 (최근 30일)
John Blue
John Blue 2019년 5월 21일
답변: Chris Portal 2019년 5월 26일
I have an array of strings and i try to display that in listbox using app designer .
My code:
classdef app1_test < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
ListBoxLabel matlab.ui.control.Label
ListBox matlab.ui.control.ListBox
end
methods (Access = private)
% Callback function
function ListBoxValueChanged(app, event)
value = app.ListBox.Value;
load('names_of_songs.mat');
app.ListBox.Value = names_of_songs;
end
end
I dont understand what am I doing wrong.
Does anyone know how I can do it.
Thank you for your time.

답변 (1개)

Chris Portal
Chris Portal 2019년 5월 26일
See the documentation for an example:
Basically, you configure the Items property to hold all the valid values for the listbox, and Value is configured to be 1 of those valid values.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by