Create a Simulink Model
Create a simple model of a damped square-wave generator. You can use this model as an example to learn other capabilities that are useful with Simulink® Desktop Real-Time™ software.
In the MATLAB® Home tab, click the Simulink button.
Click Blank Model, and then Create Model.
An empty Simulink Editor opens.
On the Simulation tab, click Library Browser.
In the Library Browser:
Select Simulink > Sources, and then add a Signal Generator block to the model.
Select Simulink > Continuous, and then add a Transfer Fcn block to the model.
Select Simulink > Sinks, and then add a Scope block to the model.
Make the following block-to-block connections:
Signal Generator output to Transfer Fcn input
Transfer Fcn output to Scope input
Double-click the Transfer Fcn block. The Block Parameters dialog box opens. In the Numerator text box, enter:
[10000]
In the Denominator text box, enter:
[1 70 10000]
Click OK.
Double-click the Signal Generator block. From the Wave form list, select
square
.In the Amplitude text box, enter:
1
In the Frequency text box, enter:
20
From the Units list, select
rad/sec
.Click OK.
The completed Simulink block diagram looks like the figure.
In the Simulink Editor, on the Simulation tab, click Save > Save as. In the File name text box, enter a file name for your Simulink model and click Save. For example, type:
sldrtex_model
The Simulink software saves your model in the file
sldrtex_model
.
The Simulink Desktop Real-Time software supports model referencing. See Model Reference Basics.
The Simulink Desktop Real-Time software supports file I/O, with constraints. See File System I/O.
To specify a default Simulink Desktop Real-Time configuration set for your model, see Specify a Default Configuration Set. If you activate this configuration set for your model, you can build your real-time application later without setting additional configuration parameters.
To configure your model manually, see Enter Configuration Parameters Manually.