comparison Map.m @ 1033:037f203b9bf5 feature/burgers1d

Merge with branch feature/advectioRV to utilize the +rv package
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 17 Jan 2019 10:44:12 +0100
parents a6c5e73ff44e
children
comparison
equal deleted inserted replaced
854:18162a0a5bb5 1033:037f203b9bf5
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