0001 function pl = remove(pl, val)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 np = nparams(pl);
0014 params = get(pl, 'params');
0015
0016 if ischar(val)
0017 idx = [];
0018 for i=1:np
0019 key = get(params(i), 'key');
0020 if ~strcmp(key, val)
0021 idx = [idx i];
0022 end
0023 end
0024 pl = plist(params(idx));
0025 if length(idx) == np
0026 warning('!!! No parameter found matching key name');
0027 end
0028 elseif isnumeric(val)
0029
0030 idx = [1:val-1 val+1:np];
0031 if max(idx)>np
0032 error('### index exceeds number of parameters');
0033 end
0034 pl = plist(params(idx));
0035
0036 else
0037 error('### unknown indexing method')
0038 end
0039
0040
0041
0042