To generate a Simulink model directly from the modeling tool
Right-click the block TestBed and select Tools > Export to Simulink.
In the Simulink Export Options dialog, set the options listed below and click OK:
Format: XML (.slx)
S-Function or Simscape: S-Function version 2
- Launch Matlab with Simulink extension, and open the TestBed.slx file with the help of the Current Folder browser.
- In the Current Folder panel, double-click on the file named TestBed.slx. The TestBed model will open up in a new Simulink window. Rearrange the blocks to reflect the signal flow arrowheads.
- Open the Library Browser either by clicking the Library Browser icon or by going to Tools > Library Browser. Click Simulink> Sinks and select Scope.
- Drag and drop one Scope block from the Sinks library list into the TestBed Simulink model. Attach a signal line segment from the Scope port onto the signal line that connects the dsp block and the scopeSignalOutput block. Repeat the process of adding a Scope block and attaching it to the signal line that connects the inputSignal block to the dsp block.
- Go to Modeling>Model Settings:
In the Simulation time section Select the Start Time as 0, and the Stop Time as 20.
In the Solver selection section, select Variable-step as the solver type.
- In the Solver details section, set the Max step size to 0.01, click Apply, and then click OK.
Go to Simulation>Run. Double-click on the Scope blocks to see the simulation results.