I have two different class types. Can I use in the map container one as a value and the other as a key?

 Réponse acceptée

Adam
Adam le 2 Juin 2017

0 votes

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.

Plus de réponses (1)

Feilin Jia
Feilin Jia le 12 Fév 2018

0 votes

No. I have the same question with you. I tried, but it gives me error. The key must be a number or character.

Catégories

En savoir plus sur Construct and Work with Object Arrays dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by