Compute discretetime derivative
Simulink / Discrete
The Discrete Derivative block computes an optionally scaled discrete time derivative as follows
$$y({t}_{n})=\frac{Ku({t}_{n})}{{T}_{s}}\frac{Ku({t}_{n1})}{{T}_{s}}$$
where
$$u({t}_{n})$$ and $$y({t}_{n})$$ are the block's input and output at the current time step, respectively.
$$u({t}_{n1})$$ is the block's input at the previous time step.
$$K$$ is a scaling factor.
$${T}_{s}$$ is the simulation's discrete step size, which must be fixed.
Do not use this block in subsystems with a nonperiodic trigger (for example, nonperiodic functioncall subsystems). This configuration produces inaccurate results.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 
