Home Questions Randomize targets

Randomize targets

Michael Huang asked 7 years ago
Hi, I am wondering is it possible to make a randomize target in each trail
1 Answers
Duncan McLean Staff answered 7 years ago
Hi Michael, There are several ways to do this, it depends on your end goal. You can simply check the box to randomize your trials in the block table. But I'm guessing you want more than that. If you want a random target in the target table then you can use the rand() function in Stateflow to pick a random number. If you want to pick a totally random location on the screen you can also use the rand() function in stateflow to make an X and Y position, then use that position to edit elements 3,4 in the VCode you display, which are the X and Y locations. The programming guide has the details on proper use of rand(). Do any of these help or is there something more specific you would like to do? Cheers! Duncan