フィルターのクリア

Want Cells in Struct to Show Up as a String

1 回表示 (過去 30 日間)
Jon
Jon 2023 年 5 月 9 日
コメント済み: Jon 2023 年 5 月 9 日
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 件のコメント
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 5 月 9 日
Can you share your data/variable by posting here in *.mat?
Jon
Jon 2023 年 5 月 9 日
Unfortunately I cannot share my file, but I will try to recreate my problem in a simpler manner.

サインインしてコメントする。

回答 (1 件)

VBBV
VBBV 2023 年 5 月 9 日
編集済み: VBBV 2023 年 5 月 9 日
T.data = table(["Apple";"Banana"])
T.data = table2array(table(["Apple";"Banana"]))
You can use table2array function as above
  1 件のコメント
Jon
Jon 2023 年 5 月 9 日
Thank you for your response.
I'm not sure if this is exactly what I need though.
Currently the table is 40x1, every element in that table is a word, and the words don't have any apostrophes around them.
Essentially I think I need to add apostrophes to each element in the 40x1 table, I will try the table2array function again.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by