title: How to compute the outer product of two binary vectors
body: <p>I am generating a random binary matrix with a specific number of ones in each row. Now, I want to take each row in the matrix and multiply it by its transpose (i.e <code>row1'*row1</code>). </p>
  
  <p>So, I am using <code>row1=rnd_mat(1,:)</code> to get the first row. However, in the multiplication step I get this error </p>
  
  <blockquote>
    <p>"Both logical inputs must be scalar. To compute elementwise TIMES, use TIMES (.*) instead." </p>
  </blockquote>
  
  <p>Knowing that I don't want to compute element-wise, I want to generate a matrix using the outer product. I tried to write <code>row1</code> manually using <code>[0 0 1 ...]</code>, and tried to find the outer product.  I managed to get the matrix I wanted.</p>
  
  <p>So, does anyone have some ideas on how I can do this?</p>