ho can i convert a structure to a matrix?
조회 수: 581 (최근 30일)
이전 댓글 표시
ho can i convert a structure to a matrix?
댓글 수: 0
채택된 답변
Walter Roberson
2015년 7월 23일
cell2mat(struct2cell(YourStructure))
댓글 수: 3
Jacqueline Kelly
2020년 9월 25일
What if the cells aren't of the same data type? I have some strings and some numbers
Walter Roberson
2020년 9월 25일
struct and cell are different datatypes; you need to be clear as to which you are working with for this purpose.
If you have a mix of strings and numbers, then what is your hope as to the datatype of the final matrix ? You can only combine strings and numbers in a single object if it is one of the composite datatypes such as struct, cell, or table.
추가 답변 (1개)
참고 항목
카테고리
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!