Change The structure of a Variable
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1565829/image.png)
댓글 수: 2
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?
채택된 답변
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.
추가 답변 (1개)
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!