vssSetDerState

Set the derivative state of a block.

Syntax

vssSetDerState(block,xd)

Inputs

block
Handle of the block used in the evaluation, compilation and simulation phases. The handle refers to an engine/core block structure.
Type: block
Dimension: -
xd
Derivative state.
Type: double | integer
Dimension: scalar | vector

Example

OML Custom Block using the API vssSetDerState to set the derivative state equal to the system's velocity that was solved in the equation of motion.

function OmlBlockFunction(block,flag)
	...
    if flag==vssBlockOutputUpdateFlag
       ...
    elseif flag==vssBlockDerivativeFlag
       xd=[(Force-k_d*x(1)-k_s*x(2))/M;x(1)];
       vssSetDerState(block,xd);    
    end
end