Running an Experiment in MATLAB
Using the Zapit API in MATLAB
The following example function presents 20 random stimuli using software timing.
The following function presents 20 random stimuli using an external hardware trigger:
Note the 0.3 seconds pause after the stopOptoStim in the first example
. This is to take into account the laser power ramp-down time which is triggered by stopOptoStim. The system will not respond to an external trigger during this period in hardware triggered mode. The pause is almost certainly only needed during demo code. In reality it is unlikely one trial will follow the previous one with a latency of <300 ms. Add a timeout to your behavior code to avoid this should it be a possibility.
Last updated