Hello,
I am using Matlab 2018a Appdesigner to build an App. When I initialize the App, I read-in text from an Excel file using xlsread and save it as a public variable/property. I then try to have a Listbox later in the code use this cell-array of strings to populate the list. It seems to me that the Appdesigner GUI forces you to manually enter each Item as a string and will not allow you to provide a cell-array of strings as the Items. Am I missing something here? Please see code snippets below highlighting the area I'm struggling with:
...relevant snippets from Appdesigner code... properties (Access = public) Listbox_RPS_Names % This is the naming list for the RPS listbox on the Geometry Tab, 2a subtab
end... skipping some lines... % Code that executes after component creation
methods (Access = private) % Code that executes after component creation function GUI_ReadIn_Data(app) GUI_Data = 'GUI_Data.xlsx'; [~,~,app.Listbox_RPS_Names] = xlsread(GUI_Data,'Specification_Information','B4:Y4'); end end... skipping down into the "Create UIFigure and components" section of the code... % Create ListBox_RPS
app.ListBox_RPS = uilistbox(app.SelectRPSPanel); app.ListBox_RPS.Items = {'app.Listbox_RPS_Names'}; app.ListBox_RPS.Position = [14 12 383 310]; app.ListBox_RPS.Value = {};
The issue is that Appdesigner forces the "app.ListBox_RPS.Items" to be a string when it should be a Cell-array…!?!? Please tell me I'm doing something silly here and missing a way to feed Appdesigner a Cell-array for these listboxes, as I have many of them that I would like to edit and update from a single file as opposed to in each individual listbox assignment.
Thanks for any insight on the matter and please let me know if you need more information about what I'm asking.
-Mike
Best Answer