SendStateMatrix

SendStateMatrix()

Description

Sends a state matrix to the Bpod device.

  • The matrix is checked first for sanity, and an error is thrown if parameters are invalid, states are referred to but not defined, etc.

  • The function returns an acknowledgement from Bpod if the matrix was sent successfully.

Syntax

Acknowledged = SendStateMatrix(StateMatrix)

Parameters

  • StateMatrix: The state matrix to be sent.

Returns

  • 1 if sent successfully, 0 if not.

Example

% This code generates a simple state matrix and sends it to Bpod.

sma = NewStateMatrix();

sma = AddState(sma, 'Name', 'State1', ...

'Timer', 1,...

'StateChangeConditions', {'Tup', 'exit'},...

'OutputActions', {});

SendStateMatrix(sma);