SUBSASGN define index assignment for parameter list properties. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: SUBSASGN define index assignment for parameter list properties. EXAMPLES: All possible assignment are possible. VERSION: $Id: subsasgn.m,v 1.3 2007/08/13 13:19:17 ingo Exp $ HISTORY: 31-01-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function A = subsasgn(A, S, B) 0002 % SUBSASGN define index assignment for parameter list properties. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: SUBSASGN define index assignment for parameter list 0007 % properties. 0008 % 0009 % EXAMPLES: All possible assignment are possible. 0010 % 0011 % VERSION: $Id: subsasgn.m,v 1.3 2007/08/13 13:19:17 ingo Exp $ 0012 % 0013 % HISTORY: 31-01-07 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 A = builtin ('subsasgn', A, S, B); 0018 0019 0020 % function pl = subsasgn(pl, index, val) 0021 % 0022 % % SUBSASGN define index assignment for parameters in list. 0023 % % 0024 % % M Hewitson 30-01-07 0025 % % 0026 % % $Id: subsasgn.m,v 1.3 2007/08/13 13:19:17 ingo Exp $ 0027 % % 0028 % 0029 % b = []; 0030 % 0031 % for i=1:length(index) 0032 % switch index(i).type 0033 % case '.' 0034 % fieldName = index(i).subs; 0035 % case '()' 0036 % switch fieldName 0037 % case 'params' 0038 % for idx = index(i).subs{1} 0039 % p = pl.params(idx); 0040 % p = set(p, 'val', val); 0041 % pl = remove(pl, idx); 0042 % pl = append(pl, p); 0043 % end 0044 % otherwise 0045 % error('### can not index field %s', fieldName); 0046 % end 0047 % end 0048 % end 0049 % 0050 % 0051 % END