0

I tried:

new_map = containers.Map('KeyType', 'double', 'ValueType', 'double')

but it doesn't work. I need a map from vector of doubles to double.

.??? No constructor 'containers.Map' with matching signature found.
Neil G
  • 32,138
  • 39
  • 156
  • 257
  • What version of MATLAB are you using? The containers are a recent addition to MATLAB. They are in 2010a but I am not sure how much farther back. – linuxuser27 Sep 19 '10 at 00:58
  • 3
    check this post, especially the comment by @zellus: http://stackoverflow.com/questions/3591942/hash-tables-in-matlab/3592050#3592050 – Amro Sep 19 '10 at 01:14

1 Answers1

4

Try the following workaround for pre 2010a versions of matlab.

key1 = 1.0;
val1 = 1.0;
mapObj = containers.Map(key1, val1);
remove(mapObj, key1);
zellus
  • 9,617
  • 5
  • 39
  • 56