1. That's my matlab code, I was hoping to be able to write it with loops 
   in Julia, because sometimes these vectorize operations can become 
   a real headache, but it's maybe hopeless to try to beat these highly 
   optimized libraries.
    
   
   function alpha = testSum(A,B,C,D,E,idx)
       alpha = zeros(100,1);
       for t=1:100 
          tmp = squeeze( sum( bsxfun(@times,A,B(:,t)), 1) );
          tmp = sum( bsxfun(@times,tmp,C(:,t)), 1);
          tmp = tmp * D(:,t);
    
          alpha(t) = tmp * E(t,idx(t));
       end
    end
   
   

Reply via email to