title: Random color matrix in matlab
body: <p>I would like to generate a matrix of random color blocks -- 10 by 10 pixel blocks of random colors -- such as:</p>
  
  <p><a href="http://i.stack.imgur.com/Jlc8L.png" rel="nofollow">http://i.stack.imgur.com/Jlc8L.png</a></p>
  
  <p>So far, I have generated random numbers and enlarged the matrix with <code>kron</code>:</p>
  
  <p><a href="http://i.stack.imgur.com/eBU0T.png" rel="nofollow">http://i.stack.imgur.com/eBU0T.png</a></p>
  
  <p>using:</p>
  
  <pre><code>I = kron(randn([10 10]), ones(10));
  imshow(I);
  </code></pre>
  
  <p>I would like to add random colors to this, but:</p>
  
  <pre><code>I = kron(randn([10 10 3]), ones(10));
  </code></pre>
  
  <p>reports:</p>
  
  <pre><code>error: invalid conversion of NDArray to Matrix
  </code></pre>
  
  <p>How can I generate a matrix of random color blocks?</p>
  
  <p>This is for use with Psychtoolbox-3 (<code>DrawTexture</code> does not seem able to scale up a 10x10 random color matrix to 100x100 <em>without</em> interpolation).</p>