From: Bruno Luong on
"Joao Henriques" <remove_this_part_jotaf98(a)hotmail.com> wrote in message <hp2i5d$pj9$1(a)fred.mathworks.com>...
> First, there's no way to create a new, empty Map and specify its KeyType/ValueType -- the Map is initialized with the default types ('char'/'any'), and if I want to index values by 'double' or something, I can't.

This has been the case but in 2010a, initialize empty Map is possible:

m=containers.Map('KeyType', 'double', 'ValueType', 'logical')

m =

containers.Map handle
Package: containers

Properties:
Count: 0
KeyType: 'double'
ValueType: 'logical'

Methods, Events, Superclasses

% Bruno
From: Joao Henriques on
"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hp43ca$mbs$1(a)fred.mathworks.com>...
> This has been the case but in 2010a, initialize empty Map is possible:
>
> m=containers.Map('KeyType', 'double', 'ValueType', 'logical')
>
> m =
>
> containers.Map handle
> Package: containers
>
> Properties:
> Count: 0
> KeyType: 'double'
> ValueType: 'logical'
>
> Methods, Events, Superclasses
>
> % Bruno

Nice! Too bad this sort of bug fixes aren't patched back into earlier versions of Matlab (to the best of my knowledge, that is).
First  |  Prev  | 
Pages: 1 2
Prev: Vectorize This
Next: Integration square