Requirements Management Interface |
 |
Running a Script from DOORS
From DOORS, you can run a MATLAB script or Simulink simulation to test the behavior of an M-file or model:
- From the MATLAB menu in DOORS, select Run script.
- The Run MATLAB Simulation dialog box appears.

- Enter MATLAB code in the Simulation script window.
- Enter code just as you would within the MATLAB command window. Workspace variables that are current in MATLAB and Simulink are available to you. You can also use
get_param
and set_param
to access model parameters. However, do not enter MATLAB comments or Handle Graphics® code. You must return any results as strings.

The sample script in the Simulation script window:
- Sets a desired range for the crank speed of the engine by defining values
for
CRANKSPEED_MIN
and CRANKSPEED_MAX.
- Runs the simulation.
- Tests the minimum and maximum values in the vector
crankspeed
against the desired minimum and maximum values.
- Displays
success
if all the values in the crankspeed
vector are within the
range or displays failure
if any value falls outside the range.
- Click Run.
- DOORS sends the script to MATLAB. MATLAB runs the M-file or simulation and then returns the results as a string to DOORS, which displays the results in the Simulation results window.
MATLAB also returns error messages to the Simulation results window.

- Vary the script to test other simulations.
- In this script you could vary the values of
CRANKSPEED_MIN
and CRANKSPEED_MAX
.
- Click Close.
- DOORS attaches the script to the current DOORS surrogate exported module so it is available the next time you want to run a MATLAB M-file or Simulink simulation from DOORS.
| Highlighting Subsystems and Blocks That Have Requirements | | Function Reference |  |