Hy!
I have an Object array: bs_ek (objects with fields, methods). I would like to create a hashmap.
for i= 1: length(bs_ek)
k(i)=bs_ek(i).id;
end
rainfallMap = containers.Map(k, bs_ek)
But I get this error message:
Error using containers.Map Specified value type does not match the type expected for this container.
I created a new CELL array with bs_ek elements:
value2 = {bs_ek(1), bs_ek(2), bs_ek(3),bs_ek(4), bs_ek(5), bs_ek(6), bs_ek(7), bs_ek(8), bs_ek(9), bs_ek(10), bs_ek(11) };
and it's work:
rainfallMap = containers.Map(k, value2)
This made a Map. But the lenght of bs_ek not fixed (not 11 every time) and I would like to change this number each start.
Thanks in advance.