I would like to generate a matrix of random color blocks -- 10 by 10 pixel blocks of random colors -- such as:
http://i.stack.imgur.com/Jlc8L.png
So far, I have generated random numbers and enlarged the matrix with kron
:
http://i.stack.imgur.com/eBU0T.png
using:
I = kron(randn([10 10]), ones(10));
imshow(I);
I would like to add random colors to this, but:
I = kron(randn([10 10 3]), ones(10));
reports:
error: invalid conversion of NDArray to Matrix
How can I generate a matrix of random color blocks?
This is for use with Psychtoolbox-3 (DrawTexture
does not seem able to scale up a 10x10 random color matrix to 100x100 without interpolation).
filterMode
flag inScreen('DrawTexture')
(cf. docs.psychtoolbox.org/DrawTexture) – towolf