ho can i convert a structure to a matrix?

135 ビュー (過去 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 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