Set listbox with excel content --Attempt to reference field of non-structure array

1 view (last 30 days)
I have a GUI in which a want to set the content of an Excel file in a listbox, the code used is:
[ndata, text, alldata] = xlsread(filename);
The Excel file contains only one column with a string in each cell. Once the xls file is read the variable text is a cell type. When I compiled I got:
Attempt to reference field of non-structure array.
Error in Register>list_register_CreateFcn (line 100)
Thanks in advance for your help,

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 15 Oct 2013
Edited: Azzi Abdelmalek on 15 Oct 2013
cell2str is not a valid Matlab function, it's cellstr and the variable text is already a cell array

Sign in to comment.

sixwwwwww on 15 Oct 2013
Dear Manual, I assume that "text" just has one cell then you do like this:
[ndata, text, alldata] = xlsread(filename);
I hope it helps
Manuel on 16 Oct 2013
Edited: Manuel on 17 Oct 2013
There is a button which opens a new GUI called Register, and when this Register is called then the listbox inside this Register needs to be created with text as content.
@Azzi Abdelmalek if you Need more data let me know.

Sign in to comment.


Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by