开发者

How do I build a map in Matlab?

开发者 https://www.devze.com 2023-01-17 04:43 出处:网络
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.

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 signatu开发者_如何学JAVAre found.


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

key1 = 1.0;
val1 = 1.0;
mapObj = containers.Map(key1, val1);
remove(mapObj, key1);
0

精彩评论

暂无评论...
验证码 换一张
取 消