title: convolution with bsxfun instead of loops in Matlab
body: <p>I want to replace the for loops with bsxfun to calculate convolution in Matlab.
  Following is the script:</p>
  
  <pre><code>for Rx = 1:Num_Rx
      for Tx= 1:Num_Tx
          Received(Rx,:)=Received(Rx,:)+conv(squeeze(channel(Rx,Tx,:))', Transmitted(Tx,:));
      end
  end
  
  % Received is a Num_Rx by N matrix, Transmitted is a Num_Tx by N matrix and channel is a 3D matrix with dimension Num_Rx, Num_Tx, N.
  </code></pre>
  
  <p>When I changed code as:</p>
  
  <pre><code>Received = bsxfun(@plus, Received, bsxfun(@conv, permute(squeeze(channel), [3 1 2]), Transmitted));
  </code></pre>
  
  <p>Error came out, which said "two non-single-dimension of input arrays must be matched". </p>
  
  <p>How could I correct this line? Thanks a lot!</p>