Azzera filtri
Azzera filtri

Replacement for the function containers.Map()

6 visualizzazioni (ultimi 30 giorni)
Ganesh Kini
Ganesh Kini il 10 Giu 2020
Hi All,
Hope you are doing good.
I was doing some project, I found out a function called containers.Map() and it works fine according to the logic.
I wanted to know if there is a alternative to that function ? could you please help me out ?
  16 Commenti
Ganesh Kini
Ganesh Kini il 10 Giu 2020
Modificato: Ganesh Kini il 10 Giu 2020
I understand what you are saying. but for now since i need to get results rather the approach. So i guess case statements would work right? atleast for my problem that i am facing
Rik
Rik il 10 Giu 2020
Yes, if you know all possible keys and values you can hard-code them with a switch like you described.

Accedi per commentare.

Risposte (1)

Puru Kathuria
Puru Kathuria il 7 Mag 2021
Hi,
You can move forward by implementing your own map data structure with getters, setters and a hash function.
Otherwise, you might hardcode the data structure if all the key value pairs are known beforehand.
  1 Commento
Rik
Rik il 7 Mag 2021
As I mentioned in this comment, I don't think a hash function is actually required. Using ismember is probably faster.

Accedi per commentare.

Categorie

Scopri di più su MATLAB Data API for C++ in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by