rbmatlab 0.10.01
|
00001 function res = lincomb_sequence(seq,sigma) 00002 %function res = lincomb_sequence(seq,sigma) 00003 % 00004 % function performing a linear combination of the elements in the 00005 % cell array seq with coefficients in sigma result is a 00006 % vector/matrix the same size as the entries of seq. 00007 % if sigma = 0, the component is not touched, i.e. the component 00008 % may also be an empty matrix. 00009 00010 % Bernard Haasdonk 15.5.2007 00011 00012 Q = length(sigma); 00013 res = seq{1}* sigma(1); 00014 for q=2:Q 00015 if sigma(q)~=0 00016 res = res + sigma(q)*seq{q}; 00017 end; 00018 end; 00019