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:

  1. From the MATLAB menu in DOORS, select Run script.
  1. The Run MATLAB Simulation dialog box appears.

  1. Enter MATLAB code in the Simulation script window.
  1. 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:

    1. Sets a desired range for the crank speed of the engine by defining values for CRANKSPEED_MIN and CRANKSPEED_MAX.
    2. Runs the simulation.
    3. Tests the minimum and maximum values in the vector crankspeed against the desired minimum and maximum values.
    4. Displays success if all the values in the crankspeed vector are within the range or displays failure if any value falls outside the range.
  1. Click Run.
  1. 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.

  1. Vary the script to test other simulations.
  1. In this script you could vary the values of CRANKSPEED_MIN and CRANKSPEED_MAX.

  1. Click Close.
  1. 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