previous

Syntax

y = previous(x,init);

Description

The previous function delays the input signal x and holds it for one sample interval. It is equivalent to the z-1 discrete time operator.

Examples

x = sin(time*0.3);

y = sample(x);

z = previous(y);

u = hold(z);

Limitations

x and y will become discrete signals. 20-sim will automatically detect the existence of discrete signals. Each chain of discrete signalswill be assigned a specific sampletime. You can set this sample time to any desired value in the Simulator (choose Properties, Simulation and Discrete System).