Conversion to string from struct is not possible.
조회 수: 60 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/994710/image.png)
How to convert to double in order to address each data in this case?
댓글 수: 3
Benjamin Thompson
2022년 5월 11일
X.data is already a matrix of doubles. Maybe you can post a smaller problem and show the output or result you are looking for? Post code or a sample MAT file with the data.
답변 (1개)
Mitch Lautigar
2022년 5월 11일
Couple ways to handle this. I'll explain the top 2.
1 - Pull the data out of the struct.
num_data = x.data;
str_data = x.textdata;
You can now change the type if you wish.
2 - Convert to a cell array/table
This will put everything into a single array/table. Though you might have to format it a little bit.
Hope it helps! If it doesn't, reply and i'll answer when I can.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!