comparison Map.m @ 979:7a5e770974ed feature/timesteppers

Merge with default
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 07 Jan 2019 16:26:00 +0100
parents a6c5e73ff44e
children
comparison
equal deleted inserted replaced
933:34b3d092a4d0 979:7a5e770974ed
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