| Communications Toolbox | ![]() |
This example illustrates how BERTool can run a MATLAB simulation function. The function is viterbisim, one of the demonstration files included with the Communications Toolbox.
To run this example, follow these steps:
Open BERTool and go to the Monte Carlo panel. (The default parameters depend on whether you have the Communications Blockset installed. Also note that the BER variable name field applies only to Simulink models.)
Set parameters as shown below.

Click Run.
BERTool runs the simulation function once for each specified value of Eb/N0 and gathers BER data. (Note that while BERTool is busy with this task, it cannot process certain other tasks, including plotting data from the other panels of the GUI.)
Then BERTool creates a listing in the data viewer.

BERTool plots the data in the BER Figure window.

To change the range of Eb/N0 while reducing the number of bits processed in each case, type [5 5.2 5.3] in the Eb/No range field, type 1e5 in the Number of bits field, and click Run.
BERTool runs the simulation function again for each new value of Eb/N0 and gathers new BER data. Then BERTool creates another listing in the data viewer.

BERTool plots the data in the BER Figure window, adjusting the horizontal axis to accommodate the new data.

Notice that the two points corresponding to 5 dB from the two data sets are different; this is because the smaller value of Number of bits in the second simulation caused the simulation to end before observing many errors. To learn more about the criteria that BERTool uses for ending simulations, see Varying the Stopping Criteria.
For another example that uses BERTool to run a MATLAB simulation function, see Example: Preparing a Simulation Function for Use with BERTool.
| Running MATLAB Simulations | Varying the Stopping Criteria | ![]() |
© 1994-2005 The MathWorks, Inc.