I want to create two random numbers, that are not too far away from each other, but also not equal... But maybe see code first:
for N=1:10
a=rand();
b=rand();
while abs(a-b) < 0.15 && abs(a-b) > 0.1
b=rand();
end
m1(N)=a;
m2(N)=b;
... The idea is, that a and b become random numbers, that are later in the for loop used to define the darkness of two figures. These should not be white and black, but also not too easy to distinguish. The experiment goes over 10 trials and the stimulus intensities should be saved in the vectors m. My problem is, that I tried to make sure that the colors fit each other in the while loop, but the values that I set there aren't used in the for loop when I need them...
So can you guys give me a tip how I can use the a and b of the while loop in the for loop? Or have you any other idea how I can handle it, that I set a randomly and b is set also randomly, but not greater than .15 or smaller than .1 as a?
Thank you so much for help!
Aucun commentaire:
Enregistrer un commentaire