jeudi 11 mai 2017

Matlab: set random colors in nuances of grey

I want to plot two grey squares, from which one is always darker than the other (participant should decide in each trial which is darker).

I've set

for N=1:20
 w=rand(1)
 z=rand(1)

And when I plot my squares I've set

'markerfacecolor', [w w w] 

respectively with z for the second square.

The problem is: The two random numbers shouldn't be the same, because when this is the case the participant can't decide with right/false, which square is darker. Can anyone help me to figure out how I can forbid, that the two random numbers become the same in one loop?




Aucun commentaire:

Enregistrer un commentaire