Want Cells in Struct to Show Up as a String
Show older comments
Hello,
I have a structure array, and the first column within that structure array is set up to be equal to the first column of another table.
That table's first column is all words, but in the structure array, it appears as '1x1 table' and not 'Apple', 'Banana', etc.
If I double-click where it says '1x1 table', I can then see where it says 'Apple'.
I'd like the names/words to be visibly in the structure array itself before double-clicking on each cell.
What I tried doing was first turning that first column of the table to its own table, then convert that entire new table to a string, but I keep on getting errors.
Let me know if this isn't clear, I can try to elaborate more if need be.
Thanks.
3 Comments
Antoni Garcia-Herreros
on 9 May 2023
Please upload the structre and the table so we can take a look.
Sulaymon Eshkabilov
on 9 May 2023
Can you share your data/variable by posting here in *.mat?
Jon
on 9 May 2023
Answers (1)
T.data = table(["Apple";"Banana"])
T.data = table2array(table(["Apple";"Banana"]))
You can use table2array function as above
Categories
Find more on Tables 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!