rbmatlab 0.10.01
general/basic/lincomb_sequence2.m
00001 function res = lincomb_sequence2(seq,sigma1,sigma2)
00002 %function res = lincomb_sequence2(seq,sigma1,sigma2)
00003 %
00004 % function performing a linear combination of the elements in the
00005 % 2d cell array seq with coefficients in sigma1 and sigma2 result is a
00006 % vector/matrix the same size as the entries of seq.
00007 % size of seq is length(sigma1) x length(sigma2)
00008 % if some sigma = 0, the component is not touched, i.e. the component
00009 % may also be an empty matrix. 
00010 
00011 % Bernard Haasdonk 15.5.2007
00012 
00013   Q1 = length(sigma1);
00014   Q2 = length(sigma2);
00015   res = zeros(size(seq{1,1}));
00016   for q1=1:Q1
00017     if sigma1(q1)~=0      
00018       for q2=1:Q2
00019         if sigma2(q2)~=0      
00020           res = res + sigma1(q1)*sigma2(q2)*seq{q1,q2};
00021         end;
00022       end;
00023     end;
00024   end;
 All Classes Namespaces Files Functions Variables