title: Octave: compare two vectors
body: <p>I have this vector:</p>
  
  <pre><code>t = 1: 10 % t = 1 2 3 ..10
  
  A= [3 4 5] % a column vector 
  </code></pre>
  
  <p>If I type: </p>
  
  <pre><code>(3 == t)
  </code></pre>
  
  <p>I get the result:</p>
  
  <pre><code>0 0 1 0 0 0 0 0 0 0 % it means: 1 at location equals, and 0 at others
  </code></pre>
  
  <p>I want to do this for vector a, meaning that it will take each element in vector A and compare and return another vector. So in this case, the result will be a 3×10 matrix.</p>
  
  <p>But this line will result in an error: <code>A==t</code>.</p>
  
  <p>Of course, I can do this by using a for loop, but I want to vectorize this operation.</p>