rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
lincomb_sequence.m
1 function res = lincomb_sequence(seq,sigma)
2 %function res = lincomb_sequence(seq,sigma)
3 %
4 % function performing a linear combination of the elements in the
5 % cell array seq with coefficients in sigma result is a
6 % vector/matrix the same size as the entries of seq.
7 % if sigma = 0, the component is not touched, i.e. the component
8 % may also be an empty matrix.
9 
10 % Bernard Haasdonk 15.5.2007
11 
12 Q = length(sigma);
13 res = seq{1}* sigma(1);
14 for q=2:Q
15  if sigma(q)~=0
16  res = res + sigma(q)*seq{q};
17  end;
18 end;
19