xPC Target    

Simulating the Model from MATLAB

You run a simulation of your Simulink model to observe the behavior of the model in nonreal time.

After you load your Simulink model into the MATLAB workspace, you can run a simulation. This procedure uses the Simulink model xpc_osc2.mdl as an example and assumes you have already loaded that model. To create this model, see Creating a Simple Simulink Model.

  1. In the MATLAB Command Window, type
  1. Simulink runs a simulation in normal mode.

  1. You can either let the simulation run to its stop time, or stop the simulation manually. To stop the simulation manually, press Ctrl+T.
  2. After Simulink finishes the simulation, type
  1. You entered the MATLAB variables tout and yout in the
    Workspace I/O pane on the Simulation Parameters dialog box. The signals are logged into memory through Outport blocks. To add an Outport block, see Adding a Simulink Outport Block and Entering Parameters for Outport Blocks.

    MATLAB opens a plot window and displays the output response. The signal from the signal generator is added to the outport block and shown in the figure below.

Your next task is to create a target application. See xPC Target Application.


  Simulating the Model with Simulink xPC Target Application