Page History
To generate a Simulink model directly from the modeling tool
...
Right-click the Block TestCaseSignalProcessor::Block TestBed and select Tools > Export to Simulink. Please see To learn more, refer to the Generating a simulation file for more information page.
Set In the Simulink Export Options dialog, set the options listed below and click OK:
Format: XML (.sdlslx)
S-Function or Simscape: S-Function version 2
- Launch Matlab with Simulink and Simscape extensions.
In Matlab’s Current Directory navigation bar, search for the file directory where the Simulink files (as well as the SysML files) are saved, and set it as the current directory. The Current Folder panel should display the generated .slx and M-files.
- extension, and open the TestBed.slx file with the help of the Current Folder browser.
- In the In the Current Folder panel, double-click on the file named SourceToSink TestBed.slx. The SourceToSink model TestBed model will open up in a new Simulink window. Rearrange the blocks to reflect the signal flow arrowheads.
- Open the the Library Browser either by using the 4-block icon either by clicking the Library Browser icon or by going to Tools > Library Browser. Find and click on Sinks among the list in the Libraries panel, which will be categorized under Simulink.
Click Simulink> Sinks and select Scope. - Drag and drop one Pull-and-drag the Scope block from the Sinks library list into the SourceToSink TestBed Simulink model. Attach a signal line segment from the Scope port onto the signal line that connects the dsp block and the scopeSignal block. Repeat Steps 6 & 7 to add a Scope block and attach scopeSignalOutput block. Repeat the process of adding a Scope block and attaching it to the signal line segment that connects the inputSignal block to the dsp block block.
- Go to Simulation > Modeling>Model Configuration Settings. This allows selecting the types of solver and the runtime of the simulation. Select a Start Time of 0, and a Stop Time of 20 (or any other reasonable number of seconds). Under Solver Options, change the solver Type to Variable-step (or any other desirable solver that is suitable). Set the Settings:
In the Simulation time section Select theStart 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
. Press Apply, then press - , click Apply, and then click OK.
- , click Apply, and then click OK.
Go to Simulation > Simulation>Run. Double-click on the Scope block blocks to see the simulation results.