ho can i convert a structure to a matrix?

조회 수: 581 (최근 30일)
Joseph
Joseph 2015년 7월 23일
댓글: Walter Roberson 2020년 9월 25일
ho can i convert a structure to a matrix?

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 23일
cell2mat(struct2cell(YourStructure))
  댓글 수: 3
Jacqueline Kelly
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
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개)

muhammed boztoprak
muhammed boztoprak 2019년 5월 30일
Really great answer!!! Thank you very much.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by