octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bug in containers.Map


From: Nicholas Jankowski
Subject: Re: A bug in containers.Map
Date: Thu, 18 Jun 2020 15:46:32 -0400

containers.Map(['foo';'bar';'baz'], [1,2])

  • In octave it creates the map with one key (the first row "foo"). This key has a value of [1,2]. if you tried to access the map with a key that equals another row ("bar" or "baz"), it will raise an error that there is no such key.
  • In MATLAB online (I don't have access to the PC version), it raises an error that the number of keys and values is not the same. 

trying it out in Matlab 2020a:

 >> containers.Map(['foo';'bar';'baz'], [1,2])
Error using containers.Map
The number of keys and values must be the same.


generally, it's not an error for Octave to do things that Matlab doesn't.  I don't know enough about this function to know what it should do and if allowing creation of the map _should_ be an error. But if that is problematic, it could be a bug worth reporting.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]