| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
This table summarizes what's new in V4.1 (R12+):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility Considerations, below. See also Summary. | Fixed Bugs | No |
New features and changes introduced in this version are organized by these topics:
This section describes enhancements to the Simulink Editor.
In Simulink 4.1, the Undo command on the Simulink Edit menu restores blocks, annotations, lines, and nodes that have moved to their original locations (see Undoing a Command in the Simulink documentation).
In Simulink 4.1, the Undo command on the Simulink Edit menu restores blocks that have been grouped into a subsystem to their original level in the model (see Undoing Subsystem Creation in the Simulink documentation).
This version makes connecting blocks significantly easier. To connect a set of source blocks to a target block, simply select the source blocks, hold down the Ctrl key and left-click the target block. Simulink software draws connecting lines between the source blocks and the destination block, neatly routing lines around intervening blocks. To connect a source block to a set of target blocks, select the target blocks, hold down the Ctrl key and left--click the source block. To connect two blocks, select the source block, and left-click the destination block while holding down the Ctrl key. Simulink software connects as many ports on the two blocks as possible (see Connecting Blocks ).
Simulink software now routes signal lines around intervening blocks when you connect them either interactively (by dragging the connecting lines or using autoconnect) or programmatically via the add_line command's new 'autorouting' option (see Autorouting Option Added to add_line Command).
This version adds an item to the Format menu, which toggles the display of (nonAuto) storage class on signal lines.
This release can save post-Release 11 models in Release 11 format. Simulink 3 (Release 11) can load and run converted models that do not use any post-Release 11 features of Simulink. Simulink 3 can load converted models that use post-Release 11 features but may not be able to simulate the model correctly. Use the Save as option from the Simulink File menu or the following command to save a model in Release 11 format.
slsaveas(SYS)
This section describes enhancements to Simulink dynamic system modeling tools.
The add_line command now optionally routes lines around intervening blocks and annotations. For example, the following command autoroutes a connection between two blocks in the vdp model.
add_line('vdp','Product/1','Mu/1','autorouting','on')
The autorouting option is off by default. See add_line in the Simulink documentation for more information.
The S-Function Builder generates an S-function from specifications that you enter in a dialog box. It provides an easy way for you to incorporate existing code into a Simulink model.
With this version, you can add custom parameters to your block diagrams.
add_param('modelname','MyParameterName','value')
delete_param('modelname','MyParameterName')
You can also use the model handle in place of the model name. See add_param and delete_param in the Simulink documentation for more information.
With this version, you can use set_param to set callbacks on ports that are triggered by changes in the ports' connectivity. The callback function parameter is named ConnectionCallback. When the port's connectivity changes (addition/deletion of line connected to the port, connection of new block to the port, etc.), Simulink software invokes the callback function with the port handle as its argument. See Port Callback Parameters for more information.
This version adds a new block parameter, named UserDataPersistent, that is off by default. Setting this parameter on, e.g.,
set_param(block-name,'UserDataPersistent','on')
causes Simulink software to include a block's user data (i.e., the value of the block's UserData parameter) in the model file when you save a model. Simulink software encodes the user data as ASCII characters and saves the encoded data in a new section of the model file called MatData. This mechanism works with all forms of MATLAB data, including arrays, structures, objects, and Simulink data objects. See Associating User Data with Blocks for more information.
This version adds a dialog item for setting the absolute tolerance for each state in the State-Space block, the Transfer Fcn block, and the Zero-Pole block. With this enhancement, you can now specify the absolute tolerance for solving every continuous state in your model.
S-functions may now request that they be eliminated from the compiled model. To do this, call ssSetBlockReduction (true) inside the S-function. This is an advanced feature provided for customers writing S-functions who want to optimize the generated code produced for their S-function. Graphical connectivity is now remapped during block reduction, eliminating a source of error during reduction (e.g., a memory reference error used to occur if Simulink software eliminated a block connected to a scope). Block reduction is now on by default, and a Simulink preference has been added for the option.
The Simulink Preferences dialog box now allows you to specify the use of Boolean logic signals by default. See Implement logic signals as Boolean data (vs. double) in the Simulink documentation for more information.
Typing sl_subsys_semantics at the MATLAB prompt now displays a set of models that illustrate the semantics of various types of subsystem blocks. The demos include formal definitions of function-call subsystems.
The top and bottom dead center detection in the engine and enginewc demo models now use a reset integrator. In previous versions, the models used a triggered subsystem to detect angular position. This method resulted in inefficiencies and a slower, less accurate solution. In addition, self-triggering subsystems are now illegal in Simulink software.
In Simulink 4.0, it was an error to specify a priority on a virtual subsystem. In Simulink 4.1, you can specify priorities on virtual subsystems.
Now all filename fields in Simulink software support the mapping of the ~ character in filenames. For example, in a To File block, you can specify ~/outdir/file.mat. On most systems, this will expand to /home/$USER/outdir/file.mat.
In a multitasking environment, deterministic results cannot be guaranteed if a slow signal feeds the enable port of an enabled subsystem that contains fast blocks. In previous versions, Simulink software did not issue a warning in some cases where this may occur.
In previous versions, Simulink software allowed you to build models containing function-call-cycles, i.e., function-call subsystems that directly or indirectly call themselves.

Such models cannot be correctly simulated. Accordingly, Simulink software now displays an error message when you attempt to run or update a diagram containing function-call cycles.
This section describes enhancements to the Simulink debugger.
The Simulink debugger (sldebug) sorted list command, slist, now displays the names of the S-functions residing inside S-function blocks.
The trace, break, zcbreak, nanbreak, and minor commands now indicate that they are disabled when in accelerator mode and you need to switch to normal mode to activate them. The spacing of several messages has been fixed so the text aligns correctly.
You can now put a break point on a function-call subsystem. Simulink software breaks when the subsystem is executed. In Release 12, entering the quit command while at a breakpoint within a function-call subsystem wouldn't always quit the debugger. Now the quit command ends the debugging session once the initiating (calling) Stateflow chart or S-function finishes executing its time step.
The display and probe commands now work for virtual blocks.
You can now step execution of a model into a Stateflow chart.
This section describes enhancements to the Simulink block libraries.
This version merges the Discrete Pulse Generator block into the Pulse Generator block. The combined block has two modes: time-based and sample-based (discrete). Time-based mode varies the step size when a variable step solver is being used to ensure that simulation steps occur at pulse on/off transitions. When a fixed step solver is used, the time-based mode computes a fixed step size that ensures that a simulation step occurs at every pulse transition. The Pulse Generator block also outputs a pulse of any real data type in sample-based as well as time-based mode.
Simulink 4.1 adds an If block and Switch Case block that can drive conditionally executed subsystems that contain instances of the new Action Port block. Action subsystems are similar to enabled subsystems, except that all blocks must run at the same rate as the If or Switch Case block.
This version also adds a For Iterator block and a While Iterator block. When placed in a subsystem, these blocks cause all of the blocks in the system to run multiple cycles during a time step. The block cycle in a For Iterator subsystem runs a specified number of times. The block cycle in a While Iterator subsystem runs until a specified condition is false. A user can limit execution of a While Iterator subsystem to a specified number of iterations to avoid infinite loops.
The new Assignment block allows a model to assign values to specified elements of a signal.
Simulink 4.1 adds a Bus Creator block that combines the output of multiple blocks into a single signal bus. A model can use the existing Signal Selector block to extract signals from the bus. The block's dialog box allows you to assign names to signals on the bus or allow the signals to inherit their names from their sources. When you double-click on a signal name in the block dialog, the source block is highlighted. There is no execution overhead in the use of bus creator/bus selector blocks.
The Sine Wave block now supports a bias factor that eliminates the need to sum with a Constant block. The Sine Wave block also has a new computational mode. This mode (called sample-based) eliminates the dependence on absolute time.
Simulink Extras (simulink_extras.mdl) contains a set flip-flop blocks. These blocks now use the new triggered subsystem latching semantics. In addition, the S-R Flip-Flop block now models a physical NOR gate (i.e., S=1, R=1 => Q=0, Q!=0, the undefined state).
The Discrete-Time Integrator and Rounding Function blocks now handle single as well as double values. The Transport Delay, Unit Delay, Variable Transport Delay, Memory, Merge, and Outport blocks can specify nonzero initial conditions when operating on fixed-point signals.
The Simulink Block Library contains a new Subsystems sublibrary. The new library contains most of the new control flow blocks as well as subsystem and subsystem-related blocks that used to reside in the Signals & Systems library. The subsystems in the new library each contain the minimum set of blocks needed to create a functioning subsystem, e.g., an input port and an output port.
Compatibility Considerations. The Simulink Block Library contains a new Subsystems sublibrary. The new library contains most of the new control flow blocks as well as subsystem and subsystem-related blocks that used to reside in the Signals & Systems library. The subsystems in the new library each contain the minimum set of blocks needed to create a functioning subsystem, e.g., an input port and an output port.
The Scope block includes the following enhancements:
A floating version of the Scope added to the Sinks block library
Floating Scope saves the signals selected for display in the model file
The Scope's toolbar buttons for toggling between floating/nonfloating mode, restoring saved axes, locking/unlocking axes, and displaying the Signal Selector
Compatibility Considerations. When sorting blocks, Simulink software now treats S-function blocks the way it treats built-in blocks. This means that S-functions now work correctly in nonvirtual subsystems when there is a direct feedback connection (in Simulink 4.0 and prior, this wasn't the case). It also means that models compile (update diagram) faster. As a side effect, the execution order for S-functions that incorrectly set the direct feedthrough flag differs from that used in previous versions of Simulink software. Consequently, models that contain invalid S-functions may produce different answers in this version of Simulink software.
This section describes features and changes to the Simulink triggered subsystems.
Now triggered subsystems enable you to implement software triggering, hardware triggering, or a combination of the two. Software triggering is defined as
if (trigger_signal_edge_detected) {
out(t) = f(in(t));
}
Hardware triggering is defined as
if (trigger_signal_edge_detected) {
out(t) = f(in(t-h)); // h == last step size
}
Compatibility Considerations. Previous to this version, triggered subsystems provided software triggering and a form of hardware triggering when a cycle involving triggered subsystems existed. Now, you must explicitly specify whether or not you'd like software or hardware triggering. This is done by selecting 'Latch (buffer) input' on the Inport blocks in a triggered subsystem.
Each input port of a triggered subsystem configures whether or not the input should be latched. A latched input provides the hardware-triggering semantics for that input port. Type sl_subsys_semantics at the MATLAB prompt for more information.
Compatibility Considerations. Before this version, you could define the output of a triggered subsystem to directly feed back into the trigger port of the subsystem (with potentially other additive signals). This resulted in an implicit delay. Now you must explicitly define the delay by inserting a memory block.
Simulink 4.0 can run models created or saved by Simulink 4.1, with the provisions outlined in the following.
Simulink 4.0 can run models created or saved by Simulink 4.1 as long as the models do not use features introduced in the new version, including new block types and block parameters. In particular, you should not attempt to use Simulink 4.0 to simulate or even open models that use the new Simulink control flow blocks. Opening such models cause Simulink 4.0 to crash.
If an S-function needs the current value of its input to compute its output, it must set its direct feedthrough flag to true.
Previously, if a direct feedthrough S-function failed to do this, Simulink software tried to provide a valid signal to the S-function's mdlOutput (M-file flag=3) or mdlGetTimeOfNextVarHit (M-file flag=4) methods. This special compensation mode for S-functions was flawed. For this reason, the current version deprecates the mode, though making it available as an option. In this version, by default, if an S-function sets its direct feedthrough flag to false during initialization, Simulink software sets the S-function's input signal to NULL (or a NaN signal for M-file S-functions) during the mdlOutput or mdlGetTimeOfNextVarHit methods. Thus, in this version, models with S-function(s) may produce segmentation violations. See matlabroot/simulink/src/sfuntmpl_directfeed.txt for more information.
This version of Simulink software does a better job of detecting and flagging invalid modeling constructs in Simulink models. The changes include:
Direct feedthrough compensation no longer occurs by default for S-functions (see Direct Feedthrough Compensation Deprecated).
S-functions are now sorted like built-in blocks (see S-Functions Sorted Like Built-In Blocks).
Simulink software no longer inserts implicit latches in triggered subsystems that directly or indirectly trigger themselves (see Self-Triggering Subsystems Are No Longer Allowed, above). Instead it signals an error when it detects a triggered subsystem loop with unlatched inputs. To avoid the error, you must select the Latch option on the triggered subsystem's input ports.
Simulink software now signals an error when it detects invalid configurations of function-call subsystems. See the Subsystem Examples block in the Subsystems library for examples of illegal modeling constructs involving function-call subsystems. You can disable this diagnostic by setting the Invalid FcnCall Connection parameter on the Diagnostics pane of the Simulation Parameters dialog box to none or warning.
Consequently models that ran in previous versions of Simulink software (sometimes producing incorrect results) may not run in the current release.
This section lists fixes to bugs that occurred in the previous version of Simulink software.
Simulink software no longer crashes when an S-function with variable sample time is placed in an atomic subsystem.
A bug related to the detection of a duplicated name in a bus that was feeding a Bus Selector block was fixed.
In Simulink 4.0, the Continuous and Discrete Transfer Function blocks and the Discrete Filter block used more memory than they needed to, particularly for the case of many poles. They now use an optimal amount of memory.
Miscellaneous bug fixes have been performed on the model loader:
The loader and saver now retain any comment lines (i.e., lines that begin with #) that are found at the top of the model file.
The loader does not crash on Windows NT® systems when file sizes are integer multiples of 4096.
The loader does not hang on corrupt models in which blocks with duplicate names are found.
The Simulink profiler now saves its files in the temporary directory. See the MATLAB command tempdir. The help was also updated.
The Chirp block now sweeps through frequencies correctly from the initial frequency at the simulation start time to the target frequency at the target time.
This version fixes several bugs related to the execution orders of function-call subsystems.
Previous versions incorrectly computed the direct feedthrough setting for nonvirtual subsystems in triggered/function-call subsystems. This resulted in incorrect execution (sorting) orders. Now all nonvirtual subsystems within triggered subsystems have their direct feedthrough (needs input) flags set for all input ports. This is needed because a nonvirtual subsystem with a triggered sample time executes both its output and update methods together within the context of the model's output method.
Simulink 4.0 incorrectly handled grounded or unconnected inputs to level-1 and level-2 S-functions requiring contiguous inputs and to some Matrix blocks. This has been fixed in Simulink 4.1.
![]() | Version 5.0 (R13) Simulink Software | Version 4.0 (R12) Simulink Software | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |