comparison Map.m @ 1018:eca4d9df9365 feature/advectionRV

Merge with default for latest changes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 11 Dec 2018 17:31:28 +0100
parents a6c5e73ff44e
children
comparison
equal deleted inserted replaced
1017:2d7c1333bd6c 1018:eca4d9df9365
57 end 57 end
58 58
59 function v = subsref(obj, S) 59 function v = subsref(obj, S)
60 switch S(1).type 60 switch S(1).type
61 case '()' 61 case '()'
62 if length(S.subs) > 1
63 error('sbplib:Map:multipleKeys', 'Multiple dimensions are not supported. Use a cell array as a key instead.');
64 end
62 k = S.subs{1}; 65 k = S.subs{1};
63 try 66 try
64 v = get(obj, k); 67 v = get(obj, k);
65 catch ME 68 catch ME
66 if strcmp(ME.identifier,'MATLAB:Containers:Map:NoKey') 69 if strcmp(ME.identifier,'MATLAB:Containers:Map:NoKey')
79 end 82 end
80 83
81 function obj = subsasgn(obj, S, v); 84 function obj = subsasgn(obj, S, v);
82 switch S(1).type 85 switch S(1).type
83 case '()' 86 case '()'
87 if length(S.subs) > 1
88 error('sbplib:Map:multipleKeys', 'Multiple dimensions are not supported. Use a cell array as a key instead.');
89 end
84 k = S.subs{1}; 90 k = S.subs{1};
85 set(obj, k, v); 91 set(obj, k, v);
86 otherwise 92 otherwise
87 error('You can''t use dot notation because Matlab(TM). What is this piece of shit software anyway?') 93 error('You can''t use dot notation because Matlab(TM). What is this piece of shit software anyway?')
88 end 94 end