powered by
Generates a stimulus boxcar vector for the specified time duration and microtime resolution based on the user-defined onsets and durations.
stimfunction(totaltime, onsets, durations, accuracy)
A vector in microtime resolution specifying the stimulus boxcar function in 1-0 coding.
Total time of the design in seconds.
Vector representing the onsets of the stimulus in seconds.
Vector representing the durations of the stimulus in seconds.
Microtime resolution in seconds.
M. Welvaert
If duration is a single number, it is assumed that all stimulus onsets have the same duration.
specifydesign
total <- 100 os <- c(1, 21, 41, 61, 81) d <- 10 out <- stimfunction(total, os, d, 0.1) rm(total,os,d,out)
Run the code above in your browser using DataLab