The default key type for map is string. If you want to use double you need to explicitly define it, e.g.
map = containers.Map('KeyType', 'double', 'ValueType', 'any');
You can add values as follows:
map(3) = 4;
map(5) = 14;
map(15) = {'fdfd', 'gfgfg'};
Getting keys:
map.keys
ans =
[3] [5] [15]
Some quick test if key can be an array of doubles:
>> keyTest = [1,2,3]';
>> class(keyTest)
ans =
double
>> map = containers.Map('KeyType', 'double', 'ValueType', 'any');
>> map(keyTest) = 4
Error using containers.Map/subsasgn
Specified key type does not match the type expected for this container.