Using Simulink |
 |
Discretizing Blocks from the Simulink Model
You can replace continuous blocks in a Simulink model with the equivalent blocks discretized in the s-domain using the Discretizing library.
The procedure below shows how to replace a continuous Transfer Fcn block in the Aircraft Dynamics Model subsystem of the f14
model with a discretized Transfer Fcn block from the Discretizing Library. The block is discretized in the s-domain with a zero-order hold transform method and a 2 second sample time.
- Open the
f14
model.
- Open the Aircraft Dynamics Model subsystem in the
f14
model.

- Open the Discretizing library window.
- Enter
discretizing
at the MATLAB command prompt. The Library: discretizing window opens. This library contains s-domain discretized blocks.

- Add the Discretized Transfer Fcn block to the f14/Aircraft Dynamics Model window.
- Click the Discretized Transfer Fcn block in Library: discretizing
window.
- Drag it into the f14/Aircraft Dynamics Model window.

- Open the parameter dialog box for the Transfer Fcn.1 block.
- Double-click the Transfer Fcn.1 block in the f14/Aircraft Dynamics Model window. The Block Parameters: Transfer Fcn.1 dialog box opens.

- Open the parameter dialog box for the Discretized Transfer Fcn block.
- Double-click the Discretized Transfer Fcn block in the f14/Aircraft Dynamics Model window. The Block Parameters: Discretized Transfer Fcn dialog box opens.

Copy the parameter information from the Transfer Fcn.1 block's dialog box to the Discretized Transfer Fcn block's dialog box.

- Enter
2
in the Sample time field.
- Select
zoh
from the Method drop-down list.
- The parameter dialog box for the Discretized Transfer Fcn. now looks like this.

- Click OK.
- The f14/Aircraft Dynamics Model window now looks like this.

- Delete the original Transfer Fcn.1 block.
- Click the Transfer Fcn.1 block.
- Press the Delete key. The f14/Aircraft Dynamics Model window now
looks like this.

- Add the Discretized Transfer Fcn block to the model.
- Click the Discretized Transfer Fcn block.
- Drag the Discretized Transfer Fcn block into position to complete the
model. The f14/Aircraft Dynamics Model window now looks like this.

| Viewing the Discretized Model | | Discretizing a Model from the MATLAB Command Window |  |