stimfunction: Generate a stimulus boxcar function.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/stimfunction.R

Description

Generates a stimulus boxcar vector for the specified time duration and microtime resolution based on the user-defined onsets and durations.

Usage

1
stimfunction(totaltime, onsets, durations, accuracy)

Arguments

totaltime

Total time of the design in seconds.

onsets

Vector representing the onsets of the stimulus in seconds.

durations

Vector representing the durations of the stimulus in seconds.

accuracy

Microtime resolution in seconds.

Details

If duration is a single number, it is assumed that all stimulus onsets have the same duration.

Value

A vector in microtime resolution specifying the stimulus boxcar function in 1-0 coding.

Author(s)

M. Welvaert

See Also

specifydesign

Examples

1
2
3
4
total <- 100
os <- c(1, 21, 41, 61, 81)
d <- 10
out <- stimfunction(total, os, d, 0.1)

neuRosim documentation built on May 1, 2019, 8:47 p.m.