A multidimensional map class

MapN provides a map class similar to containers.Map, but with multidimensional keys.

이 제출물을 팔로우합니다

MapN provides a multidimensional map container.

A MapN object contains key lists and values. A value is some unit of data that you want stored in the MapN object, and a key list is a unique reference to that data.

MapN is modelled on containers.Map, but whereas a containers.Map object is indexed by a single scalar or string key, a MapN object is indexed by an ordered set of such keys, expressed as a comma-separated list of arguments.

A MapN object is constructed like this:

M = MapN();

Values are stored using M(key1, key2, ...) = value, for example:

M(1, 'a') = 'a string value';
M(1, 'b') = 287.2;
M(2) = [1 2 3; 4 5 6];
M(2, 'x', pi) = {'a' 'cell' 'array'};

and values are retrieved using M(key1, key2, ...), for example

v = M(1, 'b');
u = M(2);

This contribution also includes a memoize function, inspired by the blog entry at http://blogs.mathworks.com/loren/2006/02/08/use-nested-functions-to-memoize-costly-functions/ The memoize function demonstrates one use of MapN.

인용 양식

David Young (2026). A multidimensional map class (https://kr.mathworks.com/matlabcentral/fileexchange/33068-a-multidimensional-map-class), MATLAB Central File Exchange. 검색 날짜: .

도움

도움 준 파일: davestanley/MultiDimensionalDictionary

카테고리

Help CenterMATLAB Answers에서 Dictionaries에 대해 자세히 알아보기

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
1.1.0.0

Fixed bug in remove method. My thanks to Xiaohu for reporting the bug.

1.0.0.0