Object as a key in a map container

2 ビュー (過去 30 日間)
ionas
ionas 2017 年 6 月 2 日
回答済み: Feilin Jia 2018 年 2 月 12 日
I have two different class types. Can I use in the map container one as a value and the other as a key?

採用された回答

Adam
Adam 2017 年 6 月 2 日
No. Keys are restricted to:
'Possible values are 'char', 'double', 'single', 'int32', 'uint32', 'int64', or 'uint64'.'
So I guess if your class inherits from one of these then you can (I don't think I have tried this), but not otherwise.

その他の回答 (1 件)

Feilin Jia
Feilin Jia 2018 年 2 月 12 日
No. I have the same question with you. I tried, but it gives me error. The key must be a number or character.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by