Change The structure of a Variable

1 回表示 (過去 30 日間)
malik abdelli
malik abdelli 2023 年 12 月 11 日
コメント済み: Voss 2023 年 12 月 11 日
Hello i wanted to ask how i can change the format of this struct.
The image below shows the struct and how it looks when i click on it.
What i want to do is when i click on loadfile i want to instantly see the table that appears when clicking on the different cells. I dont want to see the 2x277 cell. I Instantly want to get the tables in the cells under each other.
How can i do this?
Tahnk you.
  2 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 11 日
" I Instantly want to get the tables in the cells under each other.
How can i do this?"
Do you just want to access the contents of the 1st struct?
Or do you want to access the contents of all 67 structs?
malik abdelli
malik abdelli 2023 年 12 月 11 日
I want to access the contents off all 67 structs

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

採用された回答

Voss
Voss 2023 年 12 月 11 日
Here's one thing you can try:
% loadfile: 1x67 struct with one field, each containing a 2x277 cell array
C_temp = struct2cell(loadfile); % C_temp: 1x1x67 cell array, each containing a 2x277 cell array
C = cat(3,C_temp{:}); % C: 2x277x67 cell array
The last line will fail if the field of any element of loadfile contains something other than a 2x277 cell array
If it runs, then click on C in the Variables browser and see if it looks more like what you want.
  2 件のコメント
malik abdelli
malik abdelli 2023 年 12 月 11 日
thank you
Voss
Voss 2023 年 12 月 11 日
You're welcome!

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

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 12 月 11 日
Your question is not quite clear to me. If your want to get cell array converted into Table, then use cell2table() - DOC
  1 件のコメント
malik abdelli
malik abdelli 2023 年 12 月 11 日
Ok i will try to explain it better.
I have a struct named "loadfile" when i go to the workspace and click on it then i will get a lot of these "2x277 cell" as you can see in the image that i posted.
In everyone of these "2x277 cells" there is data like you can see in the image that i posted.
What i want is to get rid off this (2x277 cell) and instantly get the data inside the cells when i click on load file.
Is this explanation a bit clearer?

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by