MATLAB Answers

Put structure data into GUIDE table

16 views (last 30 days)
Douglas Anderson
Douglas Anderson on 28 Sep 2021 at 21:40
Commented: Douglas Anderson on 1 Oct 2021 at 4:35
I would like to load data from a structure 'struc' into a GUIDE table 'file_table'. The structure has the following fields:
file_name: {8×1 cell}
serial_number: {8×1 cell}
event_date_time: {8×1 cell}
ppv: {8×1 cell}
shot_assignment: {8×2 cell}
instlocs: [8×2 double]
instadd: [8×1 string]
I just use
I have tried a whole bunch of changes to the structure (the structure is from someone else's coding), with no success. What am I doing wrong? I can trim the instlocs and shot_assignment fields to be 8x1.

Accepted Answer

Geoff Hayes
Geoff Hayes on 29 Sep 2021 at 1:54
Douglas - perhaps you need to convert the struct to a table before setting the uitable. Try using struct2table to see if that helps.
Douglas Anderson
Douglas Anderson on 1 Oct 2021 at 4:35
Thank you very much, Geoff!
That works. Amazing how roundabout one sometimes has to go.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by