0001 function pl = subsasgn(pl, index, val)
0002
0003
0004
0005
0006
0007
0008
0009
0010 b = [];
0011
0012 for i=1:length(index)
0013 switch index(i).type
0014 case '.'
0015 fieldName = index(i).subs;
0016 case '()'
0017 switch fieldName
0018 case 'params'
0019 for idx = index(i).subs{1}
0020 p = pl.params(idx);
0021 p = set(p, 'val', val);
0022 pl = remove(pl, idx);
0023 pl = append(pl, p);
0024 end
0025 otherwise
0026 error(sprintf('### can not index field %s', fieldName));
0027 end
0028 end
0029 end
0030
0031
0032