Object as a key in a map container
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ionas
el 2 de Jun. de 2017
Respondida: Feilin Jia
el 12 de Feb. de 2018
I have two different class types. Can I use in the map container one as a value and the other as a key?
0 comentarios
Respuesta aceptada
Adam
el 2 de Jun. de 2017
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.
0 comentarios
Más respuestas (1)
Feilin Jia
el 12 de Feb. de 2018
No. I have the same question with you. I tried, but it gives me error. The key must be a number or character.
0 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!