Replacement for the function containers.Map()
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Rik
2020 年 6 月 10 日
Yes, if you know all possible keys and values you can hard-code them with a switch like you described.
回答 (1 件)
Puru Kathuria
2021 年 5 月 7 日
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 件のコメント
Rik
2021 年 5 月 7 日
As I mentioned in this comment, I don't think a hash function is actually required. Using ismember is probably faster.
参考
カテゴリ
Help Center および File Exchange で Data Type Identification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!