Documentation Center

  • Trial Software
  • Product Updates

Simulink Release Notes

R2014a

New Features, Bug Fixes, Compatibility Considerations

Simulink Editor

Annotations with rich text, graphics, and hyperlinks

In addition to plain text and text formatted with TeX, annotations can now include:

  • Rich text, which gives you the ability to format text and to add tables and lists, as you would using Microsoft® Word

  • Images, either by copying and pasting or by importing a graphics file

  • Hyperlinks to Web pages or other documents

Diagnostic Viewer to collect information, warnings, and error messages

In addition to displaying errors and warnings generated during simulation, the Diagnostic Viewer now displays information at the time of update diagram and build. The messages are displayed in a hierarchical structure within tabs for each model. For details, see Manage Errors and Warnings

Compatibility Considerations

The diary function does not intercept messages, errors, warning, and information transmitted to the Diagnostic Viewer.

Therefore, if you use the diary function to log messages, errors, warnings, and information generated during model build and simulation, replace instances of diary with sldiagviewer.diary in one of these ways.

  • sldiagviewer.diary('filename','encoding'), where both filename and encoding are optional arguments.

    • The default value for filename is diary.txt in the current folder.

    • A valid value for encoding is UTF-8. If you do not specify a value, the default encoding value is set.

    • The command toggles the logging state of the specified file.

    • You can keep multiple log files active simultaneously.

  • sldiagviewer.diary('on') and sldiagviewer.diary('off') toggle the logging state of the file specified in the last executed sldiagviewer.diary command.

    If no file was specified in the last command, the logging state of the default file is toggled.

Option to bring contents of a hierarchical subsystem into the parent subsystem with one click

You can now expand subsystem contents to flatten the model hierarchy. Expanding a subsystem is useful when refactoring a model. Flattening a model hierarchy can be the end result, or just one step in refactoring. For example, you could pull a set of blocks up to the parent system by expanding the subsystem, deselect the blocks that you want to leave in the parent, and then create a subsystem from the remaining selected blocks.

For details, see Expand Subsystem Contents.

Support for native OS touch gestures, such as pinch-to-zoom and panning

MathWorks® supports the use of multitouch gestures for panning and zooming on the Microsoft Windows® with a Windows 7 certified or Windows 8 certified touch display.

  • Zoom by spreading two fingers.

  • Zoom in by pinching two fingers together.

  • Pan by dragging two fingers.

Other supported Simulink® platforms that also support multitouch gestures might also support pan and zoom gestures, but MathWorks has not fully tested those platforms.

Operating system print options for models

The Print Model dialog box includes a Print using system dialog button that opens the print dialog box for your operating system. The operating system print dialog box provides printing options for models in addition to those that the Print Model dialog box provides. For example, you can use the operating system print dialog box for double-sided printing, color printing (if your print driver supports color printing), and nonstandard paper sizes. For details, see Specify the Page Layout and Print Job.

Preference for line crossing style

By default, straight signal lines that cross each other but are not connected display a slight gap before and after the vertical line where it intersects the horizontal line. You can change the line crossing style to line hops or solid lines. Use Simulink Preferences > Editor Defaults > Line crossing style. For details, see Line crossing style.

Scalable graphics output to clipboard for Macintosh

On Macintosh platforms, when you copy a model to the clipboard, Simulink now saves the model in a scalable format, in addition to a bitmap format. When you paste from the clipboard to an application, that application selects the format that best meets its requirements. For details, see Export Models to Third-Party Applications.

Sliders, dials, and spinboxes available as parameter controls in masks

In this release, Simulink provides the capability to control mask parameters through three additional widgets: sliders, dials, and spinboxes. For details, see Parameters & Dialog Pane.

Component-Based Modeling

Option to choose default variants

In R2014a, you can specify a default variant choice. If no other variant is active, Simulink selects and uses the default choice.

For more information, see Set Default Variant.

Option to choose variants that differ in number of input and output ports

In this release, variant subsystems can have different numbers of inports and outports, provided that they satisfy the following conditions:

  • The inport names are a subset of the parent variant subsystem's inport names.

  • The outport names are a subset of the parent variant subsystem's outport names.

During simulation, Simulink disables the inactive ports in a variant subsystem block.

Advisor-based workflow for converting subsystems to Model blocks

The new Model Reference Conversion Advisor simplifies the process of converting a subsystem to a referenced model. The advisor includes Fix buttons to automatically update the model for a successful conversion. After converting the subsystem, by default the advisor automatically updates the model, removing the Subsystem block and adding a Model block that references the newly created referenced model. For details, see Convert a Subsystem to a Referenced Model.

The Simulink.SubSystem.convertToModelReference command now has a UseConversionAdvisor argument, which opens the Model Reference Conversion Advisor, and an AutoFix argument, which automatically fixes several kinds of conversion issues.

Single-model workflow for algorithm partitioning and targeting of multicore processors and FPGAs

You can use the concurrent execution dialog box to configure a model for concurrent execution on heterogeneous targets.

A new example has been added. Navigate to Simulink > Examples > Modeling Features > Modeling Concurrency > Modeling Concurrent Execution on Multicore Targets.

For a list of supported heterogeneous targets, see Supported Heterogeneous Targets.

Easier MATLAB System block creation via autocompletion and browsing for System object names

The MATLAB System block dialog box has new browse and autocompletion capabilities to specify the System object™ name. It also allows creation of new System objects from templates.

Improved algebraic loop handling and reduced data copies with the Bus Selector block

The Bus Selector block processing now reduces:

  • Artificial algebraic loops involving nonvirtual buses

  • Data copies during bus element selection

  • The number of lines of generated code

Compatibility Considerations

The Bus Selector block performance enhancements result in these compatibility considerations.

  • Attaching a non-auto storage class at output of Bus Selector causes an error.

    Workaround: Insert a Signal Conversion block after the Bus Selector block, and specify the storage class on the output of the Signal Conversion block.

  • In model reference Accelerator mode, Bus Selector output signal logging using the ModelDataLogs format causes an error.

    To work around this issue, change the signal logging format to Dataset or insert a Signal Conversion block after the Bus Selector block and log the Signal Conversion block output (instead of the Bus Selector block output).

  • The priority specified on a Bus Selector block is ignored.

  • A Bus Selector block connected to root Outport block in referenced model honors the Invalid root Inport/Outport block connection diagnostic. This is an issue only if the diagnostic is set to Error or Warning. There is no impact on generated code.

    Workaround: Insert a Signal Conversion block after the Bus Selector block.

Faster response time when opening bus routing block dialog boxes and propagating signal labels

Opening the Bus Creator, Bus Selector, or Bus Assignment block dialog box is faster. Propagation of signal labels is also faster.

Usability enhancements to configure a model for concurrent execution on a target

Modeling for concurrent execution has the following enhancements:

  • You can use MATLAB System blocks at the top level of a model to model parallel computations. For more information, see Model Parallel Computations.

  • You can clear the Solver > Allow tasks to execute concurrently on target check box in the Configuration Parameters dialog for a referenced model. In this case, Simulink will not report a parameter mismatch for the model hierarchy. When this option is cleared, any Rate Transition blocks in the referenced model may have the Ensure deterministic data transfer (maximum delay) option selected.

  • Simulink now handles the data transfer for the rate transitions occurring at the top level of a model. For more information, see Configure Your Model.

  • There are new function to work with models for concurrent execution. Use these functions instead of the command-line interface from previous releases. For more information, see Command-Line Interface for Concurrent Execution.

Compatibility Considerations

Use the new functions instead of the following:

  • Simulink.SoftwareTarget.concurrentExecution

  • Simulink.SoftwareTarget.AperiodicTrigger

  • Simulink.SoftwareTarget.PeriodicTrigger

  • Simulink.SoftwareTarget.PosixSignalHandler

  • Simulink.SoftwareTarget.Task

  • Simulink.SoftwareTarget.TaskConfiguration

  • Simulink.SoftwareTarget.WindowsEventHandler

  • Simulink.SoftwareTarget.Trigger

Default setting of Underspecified initialization detection diagnostic is Simplified

Simplified initialization mode is the new default mode of initialization for all models created in R2014a. Simplified initialization mode has improved output consistency over classic initialization mode. For more information, see Conditional Subsystem Output Initialization.

However, any new configuration sets created using Simulink.ConfigSet still use classic initialization mode.

Discrete-Time Integrator block has dialog box changes for initialization

The Use Initial value as initial and reset value for parameter of the Discrete-Time Integrator block has been replaced by the Initial Condition Setting parameter. The new parameter provides options to carry out either output or state initialization. An additional option of Compatibility does exist for this parameter, but use it only for compatibility purposes.

System objects Propagates mixin methods

Four new methods have been added to the Propagates mixin class. You use this mixin when creating a new kind of System object for use in the MATLAB System block in Simulink. You use these methods to query the input and specify the output of a System object.

Simulation Analysis and Performance

Reduced setup and build time for Model blocks when using Rapid Accelerator mode

Building a model that uses model referencing in Rapid Accelerator mode is faster than in previous releases, because Simulink reuses the simulation target.

If you have Parallel Computing Toolbox™, you can enhance Rapid Accelerator build speed further by using parallel builds.

In R2014a, Simulink stores Rapid Accelerator build artifacts in the simulation cache folder instead of the code generation folder. This change avoids cluttering the code generation folder with simulation artifacts.

Compatibility Considerations

  • If you have a script that relies on Rapid Accelerator build artifacts being stored in the code generation folder, the R2014a change to the artifact storage location requires you to update that script only if you specify two different folders for the Simulink preferences Simulation cache folder and Code generation folder.

  • In R2014a, the Upgrade Advisor checks that S-functions work properly in top model Rapid Accelerator simulation. The advisor identifies and assists you with updating S-functions that meet all of the following conditions:

    • The S-function was created in R2013b or earlier, using either the S-Function Builder block or the Legacy Code Tool.

    • The S-function uses a bus signal as an input or output.

    • Simulink has added padding to that bus signal.

    Before you simulate such S-functions in a top model in Rapid Accelerator mode, regenerate the S-functions with the tool used for creating them. The Model Advisor automatically regenerates as many of these S-functions as it can and identifies any other S-functions that you must regenerate.

Performance Advisor checks that validate overall performance improvement for all suggested changes and set code generation option for MATLAB System block

  • Performance Advisor validates the overall performance improvement to your model using a final validation check. If performance is worse than baseline, Performance Advisor discards all changes and loads the original model. For more information, see Final Validation.

  • Performance Advisor uses the Check MATLAB System block simulation mode check to identify which MATLAB System blocks can generate code and changes the Simulate using parameter value to Code generation where possible. For more information, see Check MATLAB System block simulation mode.

Improved navigation of the Performance Advisor report

For improved navigation and readability, in the Performance Advisor HTML report, you can:

  • Filter the report to display results for checks that pass, warn, or fail.

  • Display check results based on a keyword search.

  • Quickly navigate to sections of the report using a navigation pane of the contents.

  • Expand and collapse content in the check results.

For more information, see Use Performance Advisor Reports.

Block behavior for asynchronous initiator with constant sample time

In the simulation target workflow, Simulink displays a warning for an asynchronous initiator with constant sample time. To avoid the warning, set the sample time parameter of the asynchronous initiator to inherited. This change in sample time parameter does not affect the code generation workflow.

Global setting for validation of checks in Performance Advisor

You can enable validation for all selected checks in Performance Advisor using a global setting. Previously, you could only enable validation for checks in Performance Advisor individually. For more information, see Select Validation Actions for the Advice.

Guided setup in Performance Advisor

The user interface in Performance Advisor has been enhanced with a guided setup and workflow. The interface helps you to follow the workflow in Performance Advisor and also select settings required for performance optimization runs. For more information, see Prepare a Model for Performance Advisor.

Project and File Management

Branching support through Git source control

Git integration with Simulink Project provides distributed source control with support for creating and merging branches and working offline. You can manage your models and source code using Git within Simulink Project.

For details, see Set Up Git Source Control.

    Tip   If you want to add version control to your project files without sharing with another user, you can create a local Git repository in your sandbox with four clicks. For details, see Add a Project to Git Source Control.

Comparison of project dependency analysis results

You can compare a Simulink Project impact analysis graph with a previously saved result of dependency analysis. This creates an interactive report you can use to investigate how the structure of project dependencies has changed.

Impact graph layout algorithm improved for easier identification of top models and their dependencies

Improved hierarchical layout algorithm for the Simulink Project Impact graph makes it easier to identify top models, now always on the left, and their dependencies, on the right. Graph layout is repeatable so the top model is always in the same place if you run dependency analysis multiple times. Graph performance is also faster. Dependencies are layered to vertically line up all files referenced by the same file and minimize layer crossings. These layers make it easier to identify dependencies at the same level. This makes it easier to see connections between a top model and its dependencies.

For details, see Perform Impact Analysis.

Impact analysis example for finding and running impacted tests

The sldemo_slproject_impact example shows how to perform impact analysis in Simulink Project to find and run impacted tests to validate a change. You can search for dependencies of modified files to identify the tests you need to run. You can run a batch processing function on the files found by impact analysis and examine the results in Simulink Project.

Performance improvements for common scripting operations such as adding and removing files and labels

Common scripting operations for programmatically adding and removing files and file labels in a Simulink Project are now faster. For example, adding a label to 100 files is up to 40 times faster. Performance improvement depends on the project size.

Conflict resolution tools to extract conflict markers

Source control tools can insert conflict markers in files. Simulink Project can identify conflict markers and offer to extract them and compare the files causing the conflict. You can then decide how to resolve the conflict.

For details, see Resolve Conflicts.

Updated Power Window Example

The Power Window Control Project example has been updated to take advantage of design concepts such as:

  • Simulink Projects

  • Referenced models

  • Variant subsystems

For more information, see Power Window Case Study.

Data Management

Data dictionary for defining and managing design data associated with models

In R2014a, Simulink provides the ability to store, edit, and access design data using a data dictionary, which functions as a persistent repository of design data that your model uses.

Rapid Accelerator mode signal logging enhanced to avoid rebuilds and to support buses and referenced models

In Rapid Accelerator mode, you can now log:

  • Bus signals (including virtual, nonvirtual, and array of buses signals)

  • Signals in referenced models

Also, in Rapid Accelerator mode, no rebuild occurs when you change:

  • The Configuration Parameters > Data Import/Export > Signal logging parameter

  • Any settings using the Signal Logging Selector

Simplified tuning of all parameters in referenced models

This release simplifies the way Simulink considers the InlineParameters option when it is set to Off. You can perform the following operations:

  • Tune all block parameters in your model during simulation, either through the parameters themselves or through the tunable variables that they reference.

  • Preserve the mapping between a block parameter and a variable in generated code even when the block parameter does not reference any tunable variables.

  • Retain the mapping between tunable workspace variables and variables in generated code, irrespective of the InlineParameters setting.

  • Set the value of InlineParameters to Off for model references.

These behaviors are consistent across models containing reusable subsystems and reference models.

The simplified behavior enhances the generated code and provides improved mapping between a block parameter and a variable in generated code.

Block parameter expressionCode generated previouslyCode generated in R2014a
Expressions referencing global variables (e.g., K+1)Variable name is not preserved. Block parameter name is preserved.
struct Parameters_model_ {
  real_T Gain_Gain; // Expression: K+1
}
y = model_P.Gain_Gain*u;
Expression is considered tunable. Variable name is preserved in code and is tunable.
real_T K = 2.0;
y = (K+1)*u;
Expressions referencing mask parameters for nonreusable subsystems (e.g., MP*3), the value of MP being a nontunable expression.Variable name is not preserved. Block parameter name is preserved.
struct Parameters_model_ {
  real_T Gain_Gain; // Expression: MP*3
}
y = model_P.Gain_Gain*u;
Expression is considered tunable. Variable name is substituted by parameter value.
struct Parameters_model_ {
  real_T Subsystem_MP; 
}
y = (model_P.Subsystem_MP * 3) * u;
Expressions referencing model arguments (resp. mask parameters) for referenced models (resp. reusable subsystems) (e.g., Arg+1)Variable name is not preserved. Block parameter name is preserved.
struct Subsystem {
  Gain_Gain; // Expression: Arg+1
}
y = model_P.Subsystem1.Gain_Gain*u;
Variable name is preserved as an argument name.
subsystem(y, u, rtp_Arg) {
  y = (rtp_Arg+1)*u;
}

Simulink.findVars supported in referenced models

In this release, Simulink provides the ability to search model reference hierarchies for variables that are used or not used.

See Simulink.findVars for information on how to run these searches from the command-line.

Saving workspace variables and their values to a MATLAB script

In a future release, Simulink will not support Simulink.saveVars, which provides the ability to save workspace variables to a MATLAB® script.

Instead, you can use the MATLAB function matlab.io.saveVariablesToScript to perform this operation from the command line.

Compatibility Considerations

If your scripts contain references to the function Simulink.saveVars, replace these references with matlab.io.saveVariablesToScript.

Frame-based signals in the To Workspace block

In the To Workspace block parameters dialog box, if you set Save format to either Array or Structure, you can set the new Save 2-D signals as parameter. By default, this new parameter is set for sample-based signals. To have the To Workspace block treat the input signal as a frame-based signal, change the setting to 2-D array (concatenate along first dimension).

Use this new To Workspace block parameter to treat an input signal to the block as a frame-based signal. This method of having Simulink treat an input signal as frame-based configures the model to work in future releases, when Simulink will no longer support using a signal property to specify that a signal is frame-based.

For information about frame-based signals, in the DSP System Toolbox™ documentation, see Frame-Based Processing.

Compatibility Considerations

Before R2014a, if you added a To Workspace block to a model, and you set Save format to either Array or Structure, you did not need to change any block parameter settings to handle frame-based signals.

In R2014a, in addition to setting Save format to either Array or Structure, you need to set the new Save 2-D signals as parameter to 2-D array (concatenate along first dimension).

If you open a model created before R2014a that inputs a frame-based signal to a To Workspace block, Simulink sets the Save 2-D signals as parameter to Inherit from input (this choice will be removed - see release notes). When you simulate the model, Simulink displays a warning, with a link to the Upgrade Advisor, which you can use to update your model to use the new frame-based signal handling approach (automatically setting Save 2-D signals as to 2-D array (concatenate along first dimension).

Simulation mode consistency for Data Import/Export pane output options parameter

The behavior for the Configuration Parameters > Data Import/Export > Output options parameter value of Produce specified output only is now consistent for Rapid Accelerator, Accelerator, and Normal mode. In all three simulation modes, this setting results in automatically generating output signal data for variable-step solvers for the start and stop times, as well as for the times that the user specifies.

Compatibility Considerations

Prior to R2014a, in Rapid Accelerator mode the Produce specified output only setting only generated data for the specified times, and did not automatically generate data for the start and stop times.

You need to update scripts that rely on:

  • Indexing that assumes that the first generated value is the first data value that you specify using the Produce specified output only setting

  • The number of the data points

Dimension mismatch handling for root Inport blocks improved

For the input and output of a root Inport block, Simulink no longer distinguishes between a dimension of 1 and a dimension that is a vector of ones.

For example, Simulink no longer reports an error when both of these conditions apply:

  • Input data for a root Inport block includes an element whose dimension is [1x1].

  • The root Inport block has as its data type for output a bus object whose corresponding element has a dimension of [1].

Compatibility Considerations

Before R2014a, Simulink reported an error for this kind of dimension mismatches. If you have tests that rely on Simulink reporting an error, you need to modify the tests to identify such mismatches explicitly.

Simulink.Bus.createObject support for structures of timeseries objects

You can use the Simulink.Bus.createObject function to create bus objects from a structure of MATLAB timeseries objects. This facilitates importing logged signal data.

Signal logging override for model reference variants

You can override programmatically a subset of signals for model reference variant systems, including:

  • Model reference variants

  • Model blocks that contain a Subsystem Variant block or model reference variant

To log a subset of signals for these model reference variant systems, set the SignalLoggingSaveFormat parameter to Dataset. For details, see Override Signal Logging Settings from MATLAB.

Improved To Workspace block default for fixed-point data

The block parameter Log fixed-point data as fi object is now enabled by default for the To Workspace block in the Simulink library. This causes Simulink to log data to the To Workspace block in a data format designed for fixed-point data.

Compatibility Considerations

You need to update any scripts that:

  • Insert from the Simulink library a To Workspace block that logs fixed-point data

  • Rely on the Log fixed-point data as fi object parameter not being enabled (which results in logging fixed-point data as doubles)

Legacy Code Tool support for 2–D row-major matrix

When you use the legacy_code function, you can now specify the automatic conversion of a matrix between a 2-D column-major format and a row-major format. Use the convert2DMatrixToRowMajor S-function option. The 2-D column-major format is used by MATLAB, Simulink, and the generated code. The row-major format is used by C. By default, the value is false (0).

Model Explorer property name filtering refined

In the Model Explorer Filter Contents edit box, when you enter a property name without specifying a value (for example, BlockType:), the Contents pane displays only those objects that have that property.

Connection to Educational Hardware

Support for Arduino Due hardware

You can use the Arduino® Due support package independently of the Arduino support package for Arduino Uno, Arduino Mega 2560, and Arduino Nano hardware. The Arduino Due support package shares the common block library with the Arduino Support package including the Ethernet and the WiFi blocks. The target hardware for this support package is a 32–bit ARM architecture-based microcontroller.

To use this support package, install Arduino Due support package as follows:

  1. In the Command Window, enter supportPackageInstaller.

  2. Using supportPackageInstaller, install the Arduino Due support package.

Support for Arduino WiFi Shield hardware

You can use the Arduino WiFi Shield with the Simulink Support Package for Arduino Hardware to connect to wireless networks. The block library for the Arduino WiFi shield hardware includes WiFi TCP/IP and WiFi UDP blocks that enable you to design wireless communication in embedded systems. The WiFi shield supports wireless external mode simulation via TCP/IP.

The block library for the Arduino WiFi Shield hardware includes:

  • Arduino WiFi TCP/IP Send and Arduino WiFi TCP/IP Receive blocks that enable TCP/IP based wireless communication.

  • Arduino WiFi UDP Send and Arduino WiFi UDP Receive blocks that enable UDP based wireless communication.

To install or update this support package, perform the steps described in Install Support for Arduino Hardware.

For more information, see Arduino Hardware

Support for LEGO MINDSTORMS EV3 hardware

You can run Simulink models on LEGO® MINDSTORMS® EV3 hardware. You can also tune parameter values in the model, and receive data from the model, while it is running on LEGO MINDSTORMS EV3 hardware.

Use the Simulink Support Package for LEGO MINDSTORMS EV3 Hardware block library to access LEGO MINDSTORMS EV3 peripherals:

To install or update this support package, perform the steps described in Install Support for LEGO MINDSTORMS EV3 Hardware.

For more information, see LEGO MINDSTORMS EV3 Hardware.

Updates to support for LEGO MINDSTORMS NXT hardware

You can use the dGPS Sensor from Dexter Industries with the Simulink Support Package for LEGO MINDSTORMS NXT Hardware. Use the LEGO MINDSTORMS NXT GPS Sensor block to measure the latitude and longitude of your current position, or get the distance and angle from your current position to a destination latitude and longitude.

To install or update this support package, perform the steps described in Install Support for LEGO MINDSTORMS NXT Hardware.

For more information, see LEGO MINDSTORMS NXT Hardware

Support for Samsung GALAXY Android devices

You can run Simulink models on the Samsung GALAXY® S4 and Tab 2 10.1 devices. You can also tune parameter values in the model, and receive data from the model, while it is running on LEGO MINDSTORMS EV3 hardware.

Use the Simulink Support Package for Samsung GALAXY Android Devices block library to access the Samsung GALAXY Android™ hardware:

To install or update this support package, perform the steps described in Install Support for Samsung GALAXY Android Devices.

For more information, see Samsung GALAXY Android Devices.

Block Enhancements

Enumerated data types in the Direct Lookup Table (n-D) block

The Direct Lookup Table (n-D) block now supports enumerated data types for its index and table data values.

Improved performance and code readability in linear search algorithm for Prelookup and n-D Lookup Table blocks

The Prelookup and n-D Lookup Table blocks have an improved linear search algorithm which improves performance and code readability.

System object file templates

The MATLAB System block has new templates to help create System objects.

Relay block output of fixed-in-minor-step continuous signal for continuous input

The Relay block now delivers fixed-in-minor-step continuous signals for continuous input. Previously, the Relay block output signal was a continuous output for a continuous input. The new sample time represents the behavior of the block more accurately.

MATLAB Function Blocks

Generating Simulation Target typedefs for imported bus and enumerated data types

You can configure Simulink to generate typedefs for imported bus and enumerated data types or to use typedefs you provide in a header file. In the Simulation Target pane of the Configuration Parameters dialog box, use the Generate typedefs for imported bus and enumeration types check box. This setting applies to model simulation for MATLAB Function blocks. For more information see Simulation Target Pane: General.

Complex data types in data stores

You can now access complex data types in Data Store Memory blocks and Simulink.Signal objects using MATLAB Function blocks.

Unicode character support for MATLAB Function block names

You can use international characters for MATLAB Function block names in the Simulink Editor.

Support for int64 and uint64 data types in MATLAB Function blocks

You can now use int64 and uint64 data types in MATLAB code inside MATLAB Function blocks. You cannot use int64 or uint64 types for input or output signals to MATLAB Function blocks.

Streamlined MEX compiler setup and improved troubleshooting

You no longer have to choose a compiler using mex -setup. mex automatically locates and uses a supported installed compiler. You can use mex -setup to change the default compiler. See Changing Default Compiler.

Code generation for additional Signal Processing Toolbox, Communications System Toolbox, and DSP System Toolbox functions and System objects

Code generation for MATLAB fminsearch optimization function, additional interpolation functions, and additional interp1 and interp2 interpolation methods

You can generate code for the interp1 function 'spline' and 'v5cubic' interpolation methods.

You can generate code for the interp2 function 'spline' and 'cubic' methods.

You can generate code for these interpolation functions:

You can generate code for these optimization functions:

Code generation for fread function

You can now generate code for the fread function.

Enhanced code generation for switch statements

Code generation now supports:

  • Switch expressions and case expressions that are noninteger numbers, nonconstant strings, variable-size strings, or empty matrices

  • Case expressions with mixed types and sizes

If all case expressions are scalar integer values, the code generation software generates a C switch statement. At run time, if the switch value is not an integer, the code generation software generates an error.

When the case expressions contain noninteger or nonscalar values, the code generation software generates C if statements in place of a C switch statement.

Code generation for value classes with set.prop methods

You can now generate code for value classes that have set.prop methods.

Code generation error for properties that use AbortSet attribute

Previously, when the current and new property values were equal, the generated code set the property value and called the set property method regardless of the value of the AbortSet attribute. When the AbortSet attribute was true, the generated-code behavior differed from the MATLAB behavior.

In R2014a, the code generation software generates an error if your code has properties that use the AbortSet attribute.

Modeling Guidelines

Model Advisor

Improved navigation of the Model Advisor report, including a navigation pane, collapsible content, and filters based on check status

For improved navigation and readability, the Model Advisor HTML report allows you to:

  • Filter the report to display results for checks that pass, warn, or fail.

  • Display check results based on a keyword search.

  • Quickly navigate to sections of the report using a table-of-contents navigation pane.

  • Expand and collapse content in the check results.

For more information, see View and Save Model Advisor Reports.

Option to run Model Advisor checks in the background

If you have a Parallel Computing Toolbox license, you can run the Model Advisor in the background, allowing you to continue working on your model during Model Advisor analysis. When you start a Model Advisor analysis run in the background, Model Advisor takes a snapshot of your model. The Model Advisor analysis does not reflect changes that you make to your model while Model Advisor is running. For more information, see Run Checks in the Background.

Upgrade Advisor check for get_param calls for block CompiledSampleTime

Upgrade Advisor has a new check to scan MATLAB files in your working environment forget_param function calls that return the block CompiledSampleTime parameter. For multirate blocks, Simulink returns this parameter as a cell array of pairs of doubles. Run this check to identify MATLAB code that accepts the block CompiledSampleTime parameter as a pair of doubles. You can edit these instances of code to accept a cell array of pairs of doubles.

Upgrade Advisor check for signal logging in Rapid Accelerator mode

When simulating your model in Rapid Accelerator mode, you can run a check in Upgrade Advisor to see if signals logged in your model are globally disabled. Using this check, you can enable signal logging globally.

For more information, see Check Rapid Accelerator signal logging.

R2013b

New Features, Bug Fixes, Compatibility Considerations

New Simulink Editor

Ability to add rich controls, links, and images to customized block interfaces using the Mask Editor

The mask editor is enhanced to support designing mask dialogs using controls such as images, links, and buttons. For details, see Masking.

Content preview for subsystems and Stateflow charts

Without opening the blocks, in the Simulink Editor you can preview the content of the following hierarchical items:

  • Subsystems

  • Model blocks

  • Stateflow® charts and subcharts

For example, the Throttle & Manifold subsystem uses content preview, and the Compression subsystem does not.

Content preview can help to make a model self-documenting.

Comment-through capability to temporarily delete blocks and connect input signals to output signals

You can comment through blocks such that they appear transparent during simulation. For more information, see Comment Blocks.

New options added to find_system command

You can exclude or include blocks from search using the IncludeCommented option of the find_system command. For more information, see Modeling Basics.

Visual cues for signal lines that cross

Unconnected signal lines that cross have a small break on either side of the intersection, to show that the signals are not connected. For example:

For details, see Signal Line Crossings.

UTF-16 character support for block names, signal labels, and annotations in local languages

You can use international characters when editing text in the Simulink Editor for the following:

  • Block names (the text below the block)

  • Block annotations (text in the Block Properties dialog box Annotations tab, for block property tokens such as %<BlockDescription>)

  • Signal names (in the signal label text box below a signal)

  • Model annotations

You can use international text for block names and signal names when using MATLAB commands such as find_system.

Unified Print Model dialog box for printing

The reorganized Print Model dialog box provides the same printing interface on Microsoft Windows, Macintosh, and Linux® platforms.

To consolidate model printing options, the Print Model dialog now includes:

  • Paper type

  • Page orientation

For details, see Printing Options.

Compatibility Considerations

The reorganized Print Model dialog box no longer has these options:

  • Selection for Print Range

    You can use tiled printing and options such as Current system and below to specify the part of a model to print.

  • Properties

    Instead, use the File > Print > Printer Setup > Properties dialog box.

Block Parameters dialog box access from Block Properties dialog box

In the Block Properties dialog box, you can open the Block Parameters dialog box by using the Open Block link. For details, see Block Properties Dialog Box.

Notification bar icon indicator for multiple notifications

After you simulate a model, if there are multiple notifications, the Simulink Editor notification bar icon becomes an arrow. For details, see Record Simulation Data.

Component-Based Modeling

MATLAB System block for including System objects in Simulink models

The MATLAB System block is a new block in the Simulink User-Defined Functions library. Use this block to create a Simulink block that includes a System object in your model. This capability is useful for including algorithms. For more information, see System Object Integration.

Variant Manager that manages all the variants in a model in one place

Variant Manager is a graphical tool that allows you to define and manage multiple variant configurations for Simulink models. For details, see Variant Management.

Improved componentization capabilities for modeling scheduling diagrams with root-level function-call inports

Models can now export functions by using root-level function-call Inport blocks. Such models can simulate in Normal, Accelerator, Rapid Accelerator, SIL, and PIL simulation modes.

Array of buses signal logging in model reference accelerator mode

You can log an array of buses signal in models using model reference accelerator mode or Normal mode. In R2013a, you could only log array of buses signals in Normal mode.

Ability to add, delete, and move input signals within Bus Creator block

The Bus Creator block includes Up, Down, Add, and Remove buttons to simplify organizing the input signals. When you add or remove signals, Simulink automatically updates the Number of inputs parameter of the Bus Creator block and maintains port connectivity in the model.

For details, see Reorder, Add, or Remove Signals in the Bus Creator block reference page.

Streamlined approach to migrating from Classic to Simplified initialization mode

Simplified initialization mode has increased flexibility, such as accepting an empty matrix ([]) for Initial output. These abilities make it easier to migrate custom libraries and models from classic to simplified initialization mode. For more information, see Conditional Subsystem Output Initialization.

Simplified display of sorted execution order

The display of sorted execution order is enhanced for subsystems and blocks such as function-call blocks, making it easier to understand the execution order in a model.

Enhanced model reference rebuild algorithm for MATLAB Function blocks

In conjunction with the Model Configuration > Model Referencing > Rebuild parameter, Simulink examines a set of known target dependencies when determining whether they have changed. R2013b adds another known target dependency: MATLAB files used by MATLAB function blocks.

For details, see Rebuild.

Simulation Analysis and Performance

LCC compiler included on Windows 64-bit platform for running simulations

The Windows 64-bit platform now includes LCC-win64 as the default compiler for running simulations. You no longer have to install a separate compiler for simulation in Stateflow and Simulink. You can run simulations in Accelerator and Rapid Accelerator modes using this compiler. You can also build model reference simulation targets and accelerate MATLAB System block simulations.

    Note:   The LCC-win64 compiler is not available as a general compiler for use with the command-line MEX in MATLAB. It is a C compiler only. You cannot use it for SIL/PIL modes.

LCC-win64 is used only when another compiler is not configured in MATLAB. To build MEX files, you must install a compiler. See Supported Compilers.

Signal logging in Rapid Accelerator mode

You can log signals in Rapid Accelerator mode. Signal logging in Rapid Accelerator mode is similar to signal logging in Normal and Accelerator mode. During model development and testing, using Rapid Accelerator mode usually speeds up simulation with signal logging. For details, see Signal Logging in Rapid Accelerator Mode.

Performance Advisor checks for Rapid Accelerator mode and data store memory diagnostics

Performance Advisor checks have been enhanced to improve simulation and performance optimization.

A single check compares all four simulation modes before recommending the optimal choice:

  • Normal

  • Accelerator

  • Rapid Accelerator

  • Rapid Accelerator with up-to-date check off

There is another check that compares compiler optimizations if the selected simulation mode is Accelerator or Rapid Accelerator.

Also, you can now disable runtime diagnostics for data store memory to reduce runtime overhead and improve simulation speed. For more information, see Diagnostics.

Long long integers in simulation targets for faster simulation on Win64 machines

If your target hardware and your compiler support the C99 long long integer data type, you can select this data type for code generation and simulation. Using long long results in more efficient generated code that contains fewer cumbersome operations and multiword helper functions. This data type also provides more accurate simulation results for fixed-point and integer simulations. If you are using Microsoft Windows (64-bit), using long long improves performance for many workflows including using Accelerator mode and working with Stateflow software.

For more information, see the Enable long long and Number of bits: long long configuration parameters on the Hardware Implementation Pane.

At the command line, you can use the following new model parameters:

  • ProdLongLongMode: Specifies that your C compiler supports the long long data type. Set this parameter to 'on' to enable ProdBitPerLongLong.

  • ProdBitPerLongLong: Describes the length in bits of the C long long data type supported by the production hardware.

  • TargetLongLongMode: Specifies whether your C compiler supports the long long data type. Set this parameter to 'on' to enable TargetBitPerLongLong.

  • TargetBitPerLongLong: Describes the length in bits of the C long long data type supported by the hardware used to test generated code.

For more information, see Model Parameters.

Auto-insertion of rate transition block

Simulink can now automatically handle rate transitions for periodic tasks even if the Greatest Common Divisor (GCD) rate is not in the model. Previously, Simulink required that a block with the GCD sample rate be present in the model to allow automatic insertion of the rate transition block. For more information, see Automatically handle rate transition for data transfer.

Compiled sample time for multi-rate blocks returns cell array of all sample times

For multi-rate blocks (including subsystems), Simulink now returns the compiled sample time for the block as a cell array of all the sample rates present in the block. Therefore, to query the CompiledSampleTime and determine if a subsystem is multi-rate, you no longer need to loop over all the blocks inside a subsystem or build up a list of sample times for the subsystem. The subsystem block CompiledSampleTime parameter now contains that information.

Previously, Simulink returned only the greatest common divisor (GCD) of all sample rates present in the block. This might cause a problem if the GCD rate did not exist in the model, thereby causing Simulink Coder to generate empty functions.

To obtain the complete list of sample times in a block, use the following command:

theBlockSampleTimes = get_param(SubsystemBlock,'CompiledSampleTime');

This is more efficient than querying the sample time for each block and sorting the list.

For more information, see Sample Times in Subsystems.

Compatibility Considerations

Because Simulink now returns the CompiledSampleTime parameter as a cell array of pairs of doubles (instead of a pair of doubles), some compatibility issues can occur.

Consider a variable blkTs, which has been assigned the compiled sample time of a multi-rate block.

blkTs = get_param(block,'CompiledSampleTime');

Here are some examples in which the original code works only if blkTs is a pair of doubles and the block is a single-rate block:

  • Example 1

    if isinf(blkTs(1))
        disp('found constant sample time')
    end
    

    Since blkTs is now a cell array, Simulink gives the following error message:

    Undefined function 'isinf' for input arguments of type 'cell'

    Instead, use this code, for which blkTs can be a cell array or a pair of doubles.

    if isequal(blkTs, [inf,0])
        disp('found constant sample time')
    end
    
  • Example 2

    if all(blkTs == [-1,-1])
        disp('found triggered sample time')
    end
    

    For the above example, since blkTs is now a cell array, Simulink gives the following error:

    Undefined function 'eq' for input arguments of type 'cell'

    Instead, use this code, for which blkTs can be a cell array or a pair of doubles.

    if isequal(blkTs, [-1,-1])
        disp('found triggered sample time')
    end
  • Example 3

    if (blkTs(1) == -1)
        disp('found a triggered context')
    end

    Again, since blkTs is now a cell array, Simulink gives the following error:

    Undefined function 'eq' for input arguments of type 'cell'

    Instead, use this code.

    if ~iscell(blkTs)
        blkTs = {blkTs};
    end
    for idx = 1:length(blkTs)
        thisTs = blkTs{idx};
        if (thisTs(1) == -1)
            disp('found a triggered context')
        end
    end

    The above code checks for a triggered type sample time (triggered or async). In cases in which a block has constant sample time ([inf,0]) in addition to triggered or async or when a block has multiple async rates, this alternative detects sample times in all such cases.

Improvement to model reference parallel build check in Performance Advisor

The model reference parallel build check has been improved to take into account parallel build overhead time when estimating overall overhead time. For more information, see Check model reference parallel build.

Improved readability in Performance Advisor reports

Tables in the HTML report generated by Performance Advisor now appear in a new format for improved clarity and readability.

Simulation Data Inspector launch using simplot command

The simplot command now launches the Simulation Data Inspector. The simplot command is no longer supported and redirects to the Simulation Data Inspector.

Use the Simulation Data Inspector to inspect and compare signal data from simulations. For more information on using the Simulation Data Inspector, see Validate System Behavior.

Compatibility Considerations

In R2013b, the simplot command launches the Simulation Data Inspector, and the return arguments to the function are empty handles. In previous releases, the simplot command returned handles to the handle-graphics figure.

Project and File Management

Impact analysis by exploring modified or selected files to find dependencies

In Simulink Project, use impact analysis to find the impact of changing particular files. You can investigate dependencies visually to explore the structure of your project. You can analyze selected or modified files to find their required and impacted files. Visualize changes and dependencies in the Impact graph.

Impact analysis can show you how a change will impact other files before making the change. For example:

  • Investigate the potential impact of a change in requirements by finding the design files linked to the requirements document.

  • Investigate change set impact by finding upstream and downstream dependencies of modified files before committing the changes. This can help you identify design and test files that might need modifications and find the tests you need to run.

You can label, open, or export the files found by impact analysis. You can use the impact analysis results to create reports or artifacts describing the impact of a change.

For details, see Perform Impact Analysis.

Option to export impact analysis results to the workspace, batch processing, or image files

In Simulink Project, after performing impact analysis, you can export the results to a workspace variable, to batch processing, or to image files. This enables further processing or archiving of impact analysis results.

For details, see Export Impact Results.

Identification of requirements documents during project dependency analysis

In Simulink Project, Dependency Analysis searches for requirements documents linked using the Requirements Management Interface. You can view linked requirements documents in Simulink Project and navigate to and from the linked documents. You can only create or edit Requirements Management links if you have Simulink Verification and Validation™.

Previously, you could find requirements documents only for a single model by generating a manifest. Now you can find requirements documents linked anywhere in your project.

Simplified label creation by dragging a label onto files in any view

In Simulink Project, add labels to files by dragging a label onto files. Create labels and categories of labels from any view. These features simplify label creation and application without any need to switch view. You can view project labels at the same time as project files or dependency analysis results.

Previously you could create new labels only at the Labels node, and you could apply a label to a single file only by opening a dialog box.

For details, see Create Labels and Add Labels to Files.

Shortcut renaming, grouping, and execution from any view using the Toolstrip

Simulink Project tools for managing shortcuts enable you to:

  • Create shortcut groups to organize shortcuts by type, for example, to separate shortcuts for loading data, opening models, generating code, and running tests.

  • Annotate shortcuts to make their purpose visible, without changing the file name or location of the script or model the shortcut points to, for example, to change a cryptic file name to a useful string for the shortcut name.

  • Execute project shortcuts from any view in Simulink Project using the toolstrip.

These features simplify shortcut management, allowing you to use shortcuts while viewing your project files or dependency analysis results.

Previously you could view and execute shortcuts only at the Shortcuts node. Now you can find and execute shortcuts whenever they are needed in the projects workflow without switching the view.

Data Management

Streamlined selection of one or more signals for signal logging

In the Simulink Editor, you no longer need to open the Signal Properties dialog box to enable signal logging for a signal. Instead:

  1. Select one or more signals.

  2. Click the Record button arrow and click Log/Unlog Selected Signals.

Simplified modeling of single-precision designs

In R2013b, you can model single-precision designs more easily.

New option to set default for underspecified data types

There is now a model-wide setting to specify the data type to use if Simulink cannot infer the type of a signal during data type propagation. You can now choose to set the default value for underspecified data types to double or single for simulation and code generation. For embedded designs that target single-precision processors, set the Default for underspecified data type configuration parameter to single to avoid introducing double data types. For more information, see Default for underspecified data type.

Operations between singles and integer or fixed-point data types avoid use of doubles

Simulink now supports strict single-precision algorithms for mixed single and integer data types for cast and math operations. Operations, such as cast, multiplication and division, use single-precision math instead of introducing higher precision doubles for intermediate calculations in simulation and code generation. You no longer have to explicitly cast integers or fixed-point inputs of these operations to single precision. To detect the presence of double data types in your model to help you refine your mixed single and integer design, use the Model Advisor Identify questionable operations for strict single-precision design check.

Compatibility Considerations

In R2013b, for both simulation and code generation, Simulink avoids the use of double data types to achieve strict single design for operations between singles and integers. In previous releases, Simulink used double data types in intermediate calculations for higher precision. You might see a difference in the numerical behavior of an operation between earlier releases and R2013b.

For example, when the cast is from a fixed-point or integer data type to single or vice versa, the type for intermediate calculations can have a big impact on the numerical results. Consider:

  • Input type: ufix128_En127

  • Input value: 1.999999999254942 — Stored integer value is (2^128 -2^100)

  • Output type: single

ReleaseCalculation performed by Fixed-Point DesignerOutput ResultDesign Goal
R2013b Y = single(2^-127) * single(2^128-2^100)
= single(2^-127) * Inf
InfStrict singles
Previous releasesY = single( double(2^-127) * double(2^128 - 2^100))
= single(2^-127 * 3.402823656532e+38)
2Higher precision intermediate calculation

There is also a difference in the generated code. Previously, Fixed-Point Designer allowed the use of doubles in the generated code for a mixed multiplication that used single and integer types.

m_Y.Out1 = (real32_T)((real_T)m_U.In1*(real_T)m_U.In2);

In R2013b, it uses strict singles.

m_Y.Out1=(real32_T)m_U.In1*m_U.In2;

To revert to the numerical behavior of previous releases, insert explicit casting from integers to doubles for the inputs of these operations.

Connection status visualization and connection method customization for root inport mapping

The Root Inport Mapping dialog box has the following updates:

  • The Root Inport Mapping dialog box now has connection status visualization. If the Root Inport Mapping status area lists warnings or failures, the software highlights the Inport block associated with the data. Warnings display as yellow Inport blocks outlined in orange, failures display as yellow Inport blocks outlined with bold red, and successes display as normal Inport blocks outlined with blue. Selecting the line item highlights the associated Inport block. For more information, see Understanding Mapping Results.

  • The root inport mapping capability has a new function, getSlRootInportMap. This function provides a new connection method for custom mappings. Use this function when you have a mapping method that is similar to, but not exactly the same as, one of the existing Simulink root inport mapping methods.

Conversion of numeric variables into Simulink.Parameter objects

You can now convert a numeric variable into a Simulink.Parameter object using a single step.

myVar = 5; % Define numerical variable in base workspace
myObject = Simulink.Parameter(myVar); % Create data object and assign variable value to data object value

Previously, you did this conversion using two steps.

myVar = 5; % Define numerical variable in base workspace
myObject = Simulink.Parameter; % Create data object
myObject.Value = myVar; % Assign variable value to data object value

Model Explorer search options summary hidden by default

To provide more space for displaying search results, the Model Explorer Search Results pane hides the summary of the search options (such as search criteria) that you used.

To view the search options summary, at the top of the Search Results pane, click the Expand Search Results button .

Simulink.DualScaledParameter class

The new Simulink.DualScaledParameter class extends the capabilities of the Simulink.Parameter class. You can define a parameter object that stores two scaled values of the same physical value. Suppose you want to store temperature measurements as Fahrenheit or Celsius values. You can define a parameter that stores the temperature in either measurement scale with a computational method to convert between the dual-scaled values.

You can use Simulink.DualScaledParameter objects in your model for both simulation and code generation. The parameter computes the internal value before simulation or code generation via the computational method, which can be a first-order rational function. This offline computation results in leaner generated code.

For more information, see Simulink.DualScaledParameter.

Legacy data type specification functions return numeric objects

In previous releases, the following functions returned a MATLAB structure describing a fixed-point data type:

Effective R2013b, they return a Simulink.NumericType object. If you have existing models that use these functions as parameters to dialog boxes, the models continue to run as before, and there is no need to change any model settings.

These functions do not offer full Data Type Assistant support. To benefit from this support, use fixdt instead.

FunctionReturn Value in Previous Releases — MATLAB structureReturn Value Effective R2013b — NumericType
float('double')
Class: 'DOUBLE'
DataTypeMode: 'Double'
float('single')
Class: 'SINGLE'
DataTypeMode: 'Single'
sfix(16)
Class: 'FIX'
    IsSigned: 1
    MantBits: 16
DataTypeMode: 'Fixed-point: unspecified scaling'
      Signedness: 'Signed'
      WordLength: 16
ufix(7)
Class: 'FIX'
    IsSigned: 0
    MantBits: 7
DataTypeMode: 'Fixed-point: unspecified scaling'
      Signedness: 'Unsigned'
      WordLength: 7
sfrac(33,5)
Class: 'FRAC'
     IsSigned: 1
     MantBits: 33
    GuardBits: 5
DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Signed'
        WordLength: 33
    FractionLength: 27
ufrac(44)
Class: 'FRAC'
     IsSigned: 0
     MantBits: 44
    GuardBits: 0
DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Unsigned'
        WordLength: 44
    FractionLength: 44
sint(55)
Class: 'INT'
    IsSigned: 1
    MantBits: 55
DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Signed'
        WordLength: 55
    FractionLength: 0
uint(77)
Class: 'INT'
    IsSigned: 0
    MantBits: 77
DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Unsigned'
        WordLength: 77
    FractionLength: 0

Compatibility Considerations

MATLAB Code

MATLAB code that depends on the return arguments of these functions being a structure with fields named Class, MantBits or GuardBits, no longer works correctly. Change the code to access the appropriate properties of a NumericType object, for example, DataTypeMode, Signedness, WordLength, FractionLength, Slope, and Bias.

C Code

Update C code that expects the data type of parameters to be a legacy structure to handle NumericType objects instead. For example, if you have S-functions that take legacy structures as parameters, update these S-functions to accept NumericType objects.

MAT-files

Effective in R2013b, if you open a Simulink model that uses a MAT-file that contains a data type specification created using the legacy functions, the model uses the same data types and behaves in the same way as in previous releases but Simulink generates a warning. To eliminate the warning, recreate the data type specifications using NumericType objects, and save the MAT-file.

You can use the fixdtupdate function to update a data type specified using the legacy structure to use a NumericType. For example, suppose you saved a data type specification in a MAT-file in a previous release as follows:

oldDataType = sfrac(16);
save myDataTypeSpecification oldDataType

Use fixdtUpdate to recreate the data type specification to use NumericType:

load DataTypeSpecification
fixdtUpdate(oldDataType)
ans = 

  NumericType with properties:

      DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Signed'
        WordLength: 16
    FractionLength: 15
           IsAlias: 0
         DataScope: 'Auto'
        HeaderFile: ''
       Description: ''

For more information, at the MATLAB command line, enter:

fixdtUpdate

Root Inport Mapping Error Messages

The error message handling has been improved for root import mapping at the consistency check phase. The Simulation Diagnostics Viewer now displays these error messages.

Root inport mapping example

The Using Simulink Mapping Modes in Custom Mapping FunctionsUsing Simulink Mapping Modes in Custom Mapping Functions example shows how to use the getSlRootInportMap function to create a mapping object. This example uses a mapping mode similar to the Simulink block name mapping mode.

Connection to Educational Hardware

Ability to run models on target hardware from the Simulink toolbar

You can use the Deploy to Hardware or Run button on the Simulink toolbar to run models on target hardware.

To enable these buttons, first configure your model to use for Run on Target Hardware.

  1. If you have not done so already, use supportPackageInstaller and install a Simulink support package.

  2. In a model, select Tools > Run on Target Hardware > Prepare to Run.

    The Configuration Parameters dialog box opens and displays the Run on Target Hardware pane.

  3. Set the Target hardware parameter to match your target hardware.

After configuring the model, you can use either button:

  • To deploy the model, click Deploy to Hardware. The model runs as a standalone application on the target hardware.

  • To use External mode, set Simulation mode to External, and then click Run. In External mode, you can tune parameters and monitor a model running on your target hardware.

    Note:   This feature works only with Simulink support packages. The names of these support packages begin with "Simulink Support Package for..."

    For more information, see What is "Run on Target Hardware"?.

    Note:   Some target hardware does not support External mode. For more information, consult the documentation for the specific target hardware.

Support for Arduino hardware available on Mac OS X

You can use Simulink Support Package for Arduino Hardware on Apple Mac OS X platform. This includes support for Arduino Mega 2560, Arduino Uno, Arduino Nano, and Arduino Ethernet Shield hardware.

To use this feature, install the Simulink Support Package for Arduino Hardware, as described in Install Support for Arduino Hardware.

Support for Arduino Ethernet Shield and Arduino Nano 3.0 hardware

You can use Simulink Support Package for Arduino Hardware with the Arduino Ethernet Shield hardware and Arduino Nano 3.0 hardware. The block library for Arduino Ethernet Shield hardware includes TCP/IP and UDP blocks that enable you to design network-enabled embedded systems.

To use this feature, install the Simulink Support Package for Arduino Hardware, as described in Install Support for Arduino Hardware.

The block library for the Arduino Ethernet Shield hardware includes the following blocks:

For more information about this feature, see the Arduino Hardware topic.

Signal Management

Port number display to help resolve error messages

You can display the port numbers in a block that an error message highlights by hovering over the block input or output ports. For details, see Display Port Numbers When Addressing Errors.

Enforced bus diagnostic behavior

For models that use bus primitives, set the Configuration Parameters > Diagnostics > Connectivity > Mux blocks used to create bus signals diagnostic to error. Bus primitives include the Bus Creator, Bus Selector, and Bus Assignment blocks, as well as bus objects.

R2013b enforces setting the diagnostic to error. Benefits of setting this diagnostic to error include:

  • Prevents introducing Mux/bus mixtures into your model. For information about the problems with that mixture, see Prevent Bus and Mux Mixtures.

  • Improves handling of feedback loops.

  • Supports important signal features, including:

    • Nonzero initialization of bus signals

    • Bus support for blocks such as Constant, Data Store Memory, From File, From Workspace, To File, and To Workspace

    • Signal label propagation enhancements

    • Arrays of buses

Compatibility Considerations

When you compile (update or simulate) a model in R2013b, Simulink analyzes the model to determine the extent to which the model uses Mux blocks to create bus signals. The table describes how Simulink handles different kinds of models at compile time, in relationship to the diagnostic.

Model ConfigurationSimulink Actions at Compile TimeYour Required Actions

No bus primitives or muxes that involve different data types

Displays no warning, error, or upgrade message related to this diagnostic

Sets diagnostic to error when you save the model

None

Bus primitives and diagnostic is set to error

None

None

No bus primitives, but one or more mux with different data types

Displays an error message prompting you to launch the Upgrade Advisor

Run the Upgrade Advisor and compile your model.

Bus primitives and diagnostic set to Warning or None

Displays an error message prompting you to launch the Upgrade Advisor

Run the Upgrade Advisor and set the diagnostic to error.

Block Enhancements

Improved performance of LUT block intermediate calculations

Blocks in the Lookup Tables library have a new internal rule for fixed-point data types to enable faster hardware instructions for intermediate calculations (with the exception of the Direct Lookup Table (n-D), Prelookup and Lookup Table Dynamic blocks). To use this new rule, select Speed for the Internal Rule Priority parameter in the dialog box. Select Precision to use the internal rule in R2013a.

Name changes that unify storage class parameters

The following parameters have been renamed to unify the names of storage class parameters.

Old NameNew Name
RTWStateStorageClassStateStorageClass
CodeGenStateStorageClassStateStorageClass

The blocks affected by this name change are Delay, Unit Delay, Memory, Discrete State-Space, Discrete Zero-Pole, Discrete Filter, Discrete Transfer Function, Data Store Memory, and Discrete-Time Integrator.

Compatibility Considerations

Simulink will not support the old parameter names in a future release. If you use the old parameter names in your code to programmatically set parameter values, replace them with the new names.

Warnings when using old parameter names with spaces

Parameter names that include spaces (including block type names) from Simulink Version 1.3 (1994) and earlier now warn. Do not use parameter names with spaces.

Compatibility Considerations

Old parameter names that include spaces (including block type names) from Simulink Version 1.3 (1994) and earlier now cause a warning if you use them with get_param, set_param, find_system, or add_block. Messages direct you to the new parameter name if it exists.

Strictly monotonically increasing time values on Repeating Sequence block

The Time values parameter in the Repeating Sequence block can take only strictly monotonically increasing values. In R2013a, this parameter could take duplicate time values. Run the Upgrade Advisor check "Check model for known block upgrade issues" to identify this issue in your model.

pow function in Math function block that supports Code Replacement Library (CRL)

The Math Function block supports the Code Replacement Library for the pow function, which is useful if you use code generation for models that use this function. For more information, see the Math Function block.

Continuous Linear Block improvements, such as diagnostics, readability, and stricter checks

The Continuous library blocks State-Space, Transfer Fcn, and Zero-Pole have been enhanced as follows:

  • Improved error diagnostics.

  • More readable generated code for large matrices.

  • Stricter checks for changes made to tunable parameters at run time.

  • Unused tunable parameters removed from generated code.

  • Ability for the State-Space block to act as a source block. This change enables the modeling of autonomous linear state-space systems.

  • The following changes in the Transfer Fcn block:

    • Computation of time-domain realization has been enhanced for better performance and error diagnostics

    • Support of sparse Jacobian computation for reduced memory usage, better implicit solver support, and improved structural analysis

MATLAB Function Blocks

Code generation for Statistics Toolbox and Phased Array System Toolbox

Code generation now supports more than 100 Statistics Toolbox™ functions. For implementation details, see Statistics Toolbox Functions.

Code generation now supports most of the Phased Array System Toolbox™ functions and System objects. For implementation details, see Phased Array System Toolbox Functions and Phased Array System Toolbox System Objects.

External C library integration using coder.ExternalDependency

You can define the interface to external code using the new coder.ExternalDependency class. Methods of this class update the compile and build information required to integrate the external code with MATLAB code. In your MATLAB code, you can call the external code without needing to update build information. See coder.ExternalDependency.

Updating build information using coder.updateBuildInfo

You can use the new function coder.updateBuildInfo to update build information. For example:

coder.updateBuildInfo('addLinkFlags','/STACK:1000000');

adds a stack size option to the linker command line. See coder.updateBuildInfo.

Conversion of MATLAB expressions into C constants using coder.const

You can use the new function coder.const to convert expressions and function calls to constants at compile time. See coder.const.

Highlighting of constant function arguments in the compilation report

The compilation report now highlights constant function arguments and displays them in a distinct color. You can display the constant argument data type and value by placing the cursor over the highlighted argument. You can export the constant argument value to the base workspace where you can display detailed information about the argument.

For more information, see Viewing Variables in Your MATLAB Code.

coder.target syntax change

The new syntax for coder.target is:

tf = coder.target('target')

For example, coder.target('MATLAB') returns true when code is running in MATLAB. See coder.target.

You can use the old syntax, but consider changing to the new syntax. The old syntax will be removed in a future release.

LCC compiler included on Windows 64-bit platform for running simulations

The Windows 64-bit platform now includes LCC-win64 as the default compiler for running simulations. You no longer have to install a separate compiler for simulation of MATLAB Function blocks.

LCC-win64 is used only when another compiler is not configured in MATLAB.

Modeling Guidelines

Model Advisor

Collapsible content within Model Advisor reports

The Model Advisor report now collapses the results, making it easier to navigate through the report.

Reorganization of Model Advisor checks

Checks previously provided with Simulink in the Model Advisor Embedded Coder® folder are now available with either Simulink Coder™ or Embedded Coder. For a list of checks available with each product, see:

Check for strict single precision usage

The new Identify questionable operations for strict single-precision design check identifies blocks that introduce double-precision operations. Use this check to help you refine your strict single design.

R2013a

New Features, Bug Fixes, Compatibility Considerations

New Simulink Editor

Reordering of tabs in tabbed windows

You can rearrange the order of tabs in a Simulink Editor window. For example, if you have opened several subsystems, to make it easier to access the tab for the last subsystem that you opened, you could select that tab and drag it to make it the first tab on the left.

Scalable vector graphics for mask icons

Images in .svg format can be used with the image command for creating block mask images in Simulink.

Simulation Stepper Default Value Change

The default value of the Interval between stored back steps stepping option is now 10. In the previous release, this value was 1.

Component-Based Modeling

Direct active variant control via logical expressions

Variant control can accept a variant object or any condition expression. Defining variant objects for use in modeling variants requires saving variant objects external to a model file. Using direct expressions in variant control reduces complexity. For more information, see Variant Systems.

Live update for variant systems and commented-out blocks

You can control active variants by setting variant controls. When you modify active variants, the display refreshes automatically; you do not need to use Update Diagram. You can also comment out blocks in your model to exclude them from simulation. For more information, see Variant Systems.

Masking of linked library blocks

You can now create masks on linked blocks. Masking a linked block (one that already has a mask) creates a stack of masks. Simulink libraries can contain blocks that become library links when copied to a model. Masking such blocks previously involved wrapping them inside a subsystem and creating a mask on that subsystem. Masking linked blocks instead uses less memory and management overhead. For more information, see Masking Linked Blocks.

Target profiling for concurrent execution to visualize task execution times and task-to-core assignment

A new pane, Profile Report on the Concurrent Execution dialog box, enables the visualization of task execution times and task-to-core affinitization. You can profile using Simulink Coder (GRT) and Embedded Coder (ERT) targets. For more information, see Profile and Evaluate.

The sldemo_concurrent_executionsldemo_concurrent_execution example has been updated to reflect the use of this capability.

Incremental block-to-task mapping workflow support enabled by automatic block-to-task assignment for multicore execution on embedded targets

This support allows for the partial mapping of blocks to tasks, allowing you to specify task assignments only for the blocks you are interested in. For more information, see Analyze Baseline.

With this change, the Map blocks to tasks pane no longer has a Get Default Configuration button.

PIL and SIL modes for concurrent execution

The following simulation modes are now supported for concurrent execution:

  • Processor-in-the-loop (PIL)

  • Software-in-the-loop (SIL)

Parameterized task periods for concurrent execution

You can now parameterize task periods for concurrent execution using variables from the MATLAB base workspace.

Relaxed configuration parameter setting requirements

Configuration requirements for model referencing have been removed. The following parameters no longer need to be the same for top and referenced models:

  • Templates > Target operating system

  • Solver > Allow tasks to execute concurrently on target

Connection to Educational Hardware

Support for Gumstix Overo hardware

Run Simulink models on Gumstix® Overo® hardware. Tune parameter values in the model, and receive data from the model, while it is running on Gumstix Overo hardware.

Use the Simulink Support Package for Gumstix Overo Hardware block library to access Gumstix Overo peripherals:

To get these capabilities and the block library, enter targetinstallertargetinstaller in a MATLAB Command Window. Then, use Support Package Installer to install the support package for Gumstix Overo hardware. For more information, see the Gumstix Overo topic.

After installing the support package, you can open the block library by entering overolib in the MATLAB Command Window. The Simulink Support Package for Gumstix Overo Hardware block library is also available in the Simulink Library Browser.

Support for Raspberry Pi hardware

Run Simulink models on Raspberry Pi™ hardware. Tune parameter values in the model, and receive data from the model, while it is running on Raspberry Pi hardware.

Use the Simulink Support Package for Raspberry Pi Hardware block library to access Raspberry Pi peripherals:

To get these capabilities and the block library, enter targetinstallertargetinstaller in a MATLAB Command Window. Then, use Support Package Installer to install the support package for Raspberry Pi hardware. For more information, see the Raspberry Pi topic.

After installing the support package, you can open the block library by entering pilib in the MATLAB Command Window. The Simulink Support Package for Raspberry Pi Hardware block library is also available in the Simulink Library Browser.

Blocks for GPIO, LED, and eSpeak Text to Speech on BeagleBoard and PandaBoard

The block libraries for BeagleBoard and PandaBoard hardware include four new blocks:

To get these blocks, enter targetinstallertargetinstaller in a MATLAB Command Window. Then, use Support Package Installer to install the support package for BeagleBoard or PandaBoard hardware. For more information, see the BeagleBoard or PandaBoard topics.

After installing the support package, you can open the updated block libraries. In a MATLAB Command Window, enter beagleboardlib or pandaboardlib. You can also access these block libraries through the Simulink Library Browser.

Blocks for Compass and IR Receiver sensors on LEGO MINDSTORMS NXT

The block library for LEGO MINDSTORMS NXT hardware includes two new blocks:

To get these blocks, in a MATLAB Command Window, enter targetinstallertargetinstaller. Then, use Support Package Installer to install the support package for LEGO MINDSTORMS NXT hardware. For more information, see the LEGO MINDSTORMS NXT topic.

After installing the support package, you can open the updated block library. In a MATLAB Command Window, enter legonxtlib. The block library is also available in the Simulink Library Browser.

Project and File Management

Simplified scripting interface for automating Simulink Project tasks

Simulink Projects provide a new API with shorter commands for automating project tasks with file and label management.

See Simulink Projects for links to project functions.

Compatibility Considerations

The new Simulink Projects API replaces the class Simulink.ModelManagement.Project.CurrentProject and its methods. Simulink.ModelManagement.Project.CurrentProject will be removed in a future release. Instead, use simulinkproject and related functions for project manipulation.

Option to use elements from multiple templates when creating a new project

When you create a new project, you can select multiple templates to apply. You can select templates directly on the New Project menu.

Saving and reloading of dependency analysis results

The Simulink Project Tool remembers the results of previous dependency analysis and saves the results with your project. You can view your previous results without having to run time-consuming analysis again. You can also save and reload previous results.

Robust loading of projects with conflicted metadata project definition files

The Simulink Project Tool now has tolerance for loading projects with conflicts in metadata project definition files. You can load the conflicted project and resolve the conflicts. In previous releases you could not load a project with conflicts in the metadata.

New project preferences to control logging and warnings

Simulink Project Tool has a new Preferences dialog where you can control options for logging and warnings.

Data Management

Fixed-Point Advisor support for model reference

The Fixed-Point Advisor now performs checks on referenced models. It checks the entire model reference hierarchy against fixed-point guidelines. The Advisor also provides guidance about model configuration settings and unsupported blocks to help you prepare your model for conversion to fixed point.

Arrays of buses loading and logging

You can log array of buses signal data using signal logging. For details, see step 5 in Set Up a Model to Use Arrays of Buses.

You can load array of buses data to a root Inport block. For details, see Import Array of Buses Data.

Root Inport Mapping tool changes

The following are changes to the Root Inport Mapping tool:

  • The Root Inport Mapping tool can now import the following additional data formats from a MAT-file:

    • Array of buses

    • Asynchronous function-call signals

  • A new button, Map Signals, has been added to the Mapping Mode section of the tool. Use this button to map the data to the root-level ports. Then, use the Apply or OK buttons to commit the changes to the model.

  • The Status area of the tool has been visually updated to better display the mapping status.

  • A new function, getInputString, enables you to create a comma-separated list of variables to be mapped.

New Root Inport Mapping Examples

The following examples show how to use the Root Inport Mapping dialog box:

  • Converting Test Harness Model to Harness-Free Model

    The slexAutotransRootInportsExampleslexAutotransRootInportsExample example shows how to convert a harness model using Signal Builder block as an input to a harness-free model with root inports.

  • Custom Mapping for External Inputs of a Model

    This example, available from Simulink > Simulink Examples > Modeling Features, shows how to create a custom mapping function for mapping data to root-level input ports.

Level-1 data classes not supported

Simulink no longer supports level-1 data classes. Extend Simulink data classes using MATLAB class syntax instead.

For more information, see Define Data Classes.

To upgrade your level-1 data classes, see Upgrade Level-1 Data Classes.

Compatibility Considerations

When you upgrade your level-1 data classes, the way that MATLAB code is generated and model files are loaded remains the same. However, you may encounter errors if your code includes the following capabilities specific to level-1 data classes:

  • Inexact property names such as a.datatype instead of the stricter a.DataType.

  • Vector matrix containing Simulink.Parameter and Simulink.Signal data objects. Previously, using level-1 data classes, you could define a vector matrix v as follows:

    a = Simulink.Signal;
    b = Simulink.Parameter;
    v = [a b];

    Such mixed vector matrices are no longer supported.

In these cases, modify your code to replace these capabilities with those supported by MATLAB class syntax. For more information on how to make these replacements, see Begin Using Object-Oriented Programming in MATLAB documentation.

Simulink data type classes do not support inexact enumerated property value matching

Previously, Simulink data type classes permitted partial enumerated property value matching and did not enforce case sensitivity. For example, after creating a Simulink.NumericType data type object

a = Simulink.NumericType;

you could set the value of property DataTypeMode of the object by using one of the following commands:

  • Partial matching of enumerated property value:

    a.DataTypeMode = 's';

    Here, 's' is equivalent to 'Single'.

  • Case-insensitive matching of enumerated property value:

    a.DataTypeMode = 'Fixed-Point: binary point scaling';

    Here, 'Fixed-Point: binary point scaling' is equivalent to 'Fixed-point: binary point scaling'.

Now, Simulink data type classes do not permit partial or case-insensitive matches of enumerated property values.

Compatibility Considerations

You may encounter errors or warnings if your code relies on setting enumerated property values of data type objects using inexact matches. In these case, replace your code so that these property values are set using exact matches. For example, after creating a Simulink.NumericType data type object

b = Simulink.NumericType;

set the value of property DataTypeMode using the following command:

b.DataTypeMode = 'Single';

    Tip   Tab completion works with enumerated properties. For example, if you enter a property name followed by an equal sign, MATLAB pops up a selection box with a list of values for that property.

Simulation Analysis and Performance

Simulation Performance Advisor report that shows both check results and actions taken

Performance Advisor HTML report now include actions in addition to checks. For more information, see View Performance Advisor Reports.

Improved simulation performance when stepping back is enabled

The performance of stepping back using the Simulation Stepper has been improved. For more information on the Simulation Stepper, see Simulation Stepping.

Simulation Data Inspector run-configuration options for names and placement in run list

When managing many runs in the Simulation Data Inspector, you can specify whether to add new runs at the top or bottom of the Signal Browser table. In addition, you can customize automatic naming of new runs added to the Simulation Data Inspector. For more information, see Run Management Configuration.

Arrays of buses displayed in Simulation Data Inspector

The Simulation Data Inspector records logged arrays of buses. After recording an array of buses, the Simulation Data Inspector can display this data in a hierarchical format.

Simulation Data Inspector overwrite run specification

In the Simulation Data Inspector, you can overwrite a previously recorded run with a new run using the Overwrite Run button. Overwriting a run eliminates a large accumulation of runs when you are establishing a baseline run for comparing simulation runs. When you overwrite a run, signal selection and color are retained.

Signal Management

Referenced models sample times

You can use one or more variable sample times in a referenced model. You can include blocks with variable sample times, such as the Pulse Generator block, in a referenced model in Normal or Accelerator mode. The Sample Time Legend reflects this new capability with the following:

  • Text label Variable in the Description column.

  • Display of hierarchical structure of the value in the reference model hierarchy in the Value column.

For more information, see Designate Sample Times.

Opening a model that contains referenced models with variable sample times generates errors in releases prior to R2013a.

Compatibility Considerations

If you want to use an S-function block that contains one variable sample time in an R2013a referenced model, recompile the S-function code in the R2013a environment first. Otherwise, compiling this model reference hierarchy in the R2013a environment generates errors.

Triggered subsystem sample times

The Sample Time Legend now displays the source of triggered subsystem sample times. The block area of a model now has annotations that show the triggered sample time and the sample time index number. For more information, see Designate Sample Times

Simulation of variable-size scalar signals

Previously, a model that used a variable-size scalar signal (width equals 1) would cause an error during a model update. You can now simulate a model with a variable-size scalar signal.

Block Enhancements

CORDIC approximation method for atan2 function of Trigonometric Function block

The Trigonometric Function block now supports the CORDIC approximation method for computing the output of the atan2 function. For more information, see Trigonometric Function.

Product and Gain blocks support Basic Linear Algebra Subprogram (BLAS) library

The Product and Gain blocks now support the Basic Linear Algebra Subprogram (BLAS) library. The BLAS library is a library of external linear algebra routines optimized for fast computation of large matrix operations. Whenever possible, the blocks use BLAS library routines to increase simulation speed.

Performance Advisor check for Delay block circular buffer setting

To improve simulation, the Performance Advisor checks that each Delay block in the model uses the appropriate buffer type. By default, the block uses an array buffer (the Use circular buffer for state option is not selected). However, when the delay length is large, a circular buffer can improve execution speed by keeping the number of copy operations constant. For more information, see Check Delay block circular buffer setting.

MATLAB Function Blocks

Masking of MATLAB Function blocks to customize appearance, parameters, and documentation

In R2013a, you can mask a MATLAB Function block directly. In previous releases, you had to place the MATLAB Function Block in a subsystem, and then mask that subsystem.

Compatibility Considerations

In R2013a, MATLAB scripts or functions that rely on the MaskType property of MATLAB Function blocks need to be updated. For example, get_param(handle_to_block, 'MaskType') or get_param(handle_to_block, 'MaskDescription') now returns an empty value. Using find_system(block_diagram_root,'SFBlockType','MATLAB Function') returns all MATLAB Function blocks. Using get_param(handle_to_block,'SFBlockType') returns MATLAB Function. Do not create masks with Mask Type Stateflow, because the behavior is unpredictable.

File I/O function support

The following file I/O functions are now supported for code generation:

Support for nonpersistent handle objects

You can now generate code for local variables that contain references to handle objects or System objects. In previous releases, generating code for these objects was limited to objects assigned to persistent variables.

Include custom C header files from MATLAB code

The coder.cinclude function allows you to specify in your MATLAB code which custom C header files to include in the generated C code. Each header file that you specify using coder.cinclude is included in every C/C++ file generated from your MATLAB code. You can specify whether the #include statement uses double quotes for application header files or angle brackets for system header files in the generated code.

For example, the following code for function foo specifies to include the application header file mystruct.h in the generated code using double quotes.

function y = foo(x1, x2)
%#codegen
coder.cinclude('mystruct.h');

...

For more information, see coder.cinclude.

Load from MAT-files

MATLAB Coder now supports a subset of the load function for loading run-time values from a MAT-file while running a MEX function. It also provides a new function, coder.load, for loading compile-time constants when generating MEX or standalone code. This support facilitates code generation from MATLAB code that uses load to load constants into a function. You no longer have to manually type in constants that were stored in a MAT-file.

To view implementation details for the load function, see Functions Supported for Code Generation — Alphabetical List.

For more information, see coder.load.

coder.opaque function enhancements

When you use coder.opaque to declare a variable in the generated C code, you can now also specify the header file that defines the type of the variable. Specifying the location of the header file helps to avoid compilation errors because the code generation software can find the type definition more easily.

You can now compare coder.opaque variables of the same type. This capability helps you verify, for example, whether an fopen command succeeded.

null = coder.opaque('FILE*','NULL','HeaderFile','stdio.h');
ftmp = null;
ftmp = coder.ceval('fopen',fname,permission);
if ftmp == null
  % Error - file open failed
end

For more information, see coder.opaque.

Complex trigonometric functions

You can now use complex acosD, acotD, acscD, asecD, asinD, atanD, cosD, cscD, cotD, secD, sinD, and tanD functions with the MATLAB Function block.

Support for integers in number theory functions

Code generation supports integer inputs for the following number theory functions:

Enhanced support for class property initial values

If you initialize a class property, you can now assign a different type to the property when you use the class. For example, class foo has a property prop1 of type double.

classdef foo %#codegen
  properties
	   prop1= 0;
  end
  methods
    ...
  end
end

Function bar assigns a different type to prop1.

fumction bar %#codegen
  f=foo;
  f.prop1=single(0);
  ...

In R2013a, code generation ignores the initial property definition and uses the reassigned type. In previous releases, code generation did not support this reassignment and failed.

Compatibility Considerations

In previous releases, if the reassigned property had the same type as the initial value but a different size, the property became variable-size in the generated code. In R2013a, code generation uses the size of the reassigned property, and the size is fixed. If you have existing MATLAB code that relies on the property being variable-size, you cannot generate code for this code in R2013a. To fix this issue, do not initialize the property in the property definition block.

For example, you can no longer generate code for the following function bar.

Class foo has a property prop1 which is a scalar double.

classdef foo %#codegen
  properties
	   prop1= 0;
  end
  methods
    ...
  end
end

Function bar changes the size of prop1.

fumction bar %#codegen
  f=foo;
  f.prop1=[1 2 3];
  % Use f
  disp(f.prop1); 
  f.prop1=[1 2 3 4 5 6 ];

Default use of Basic Linear Algebra Subprograms (BLAS) Libraries

Code generated for MATLAB Function blocks now uses BLAS libraries whenever they are available. There is no longer an option to turn off the use of these libraries.

Compatibility Considerations

If existing configuration settings disable BLAS, code generation now ignores these settings.

Function being removed

The emlmex function has been removed.

Compatibility Considerations

The emlmex function generates an error in R2013a.

Modeling Guidelines

Modeling Guidelines for High-Integrity Systems

MathWorks Automotive Advisory Board Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow

The MathWorks Automotive Advisory Board (MAAB) working group created Version 3.0 of the MAAB Guidelines Using MATLAB, Simulink, and Stateflow. See MAAB Control Algorithm Modeling for the MathWorks presentation of the guidelines.

Model Advisor

Model Advisor checks reorganized in a future release

In a future release, the Model Advisor checks will be reorganized.

Compatibility Considerations

MathWorks will review the products and licenses required to run the Model Advisor checks.

Model Advisor navigation between Upgrade Advisor, Performance Advisor, and Code Generation Advisor

In the Model Advisor window, you can select:

  • Code Generation Advisor to help configure your model to meet code generation objectives.

  • Upgrade Advisor to help upgrade models.

  • Performance Advisor to help improve the simulation performance of your model.

Report

Single file HTML

Images in the Model Advisor html report are now embedded within the file, making it easier to export and maintain the report. Previously, the icon images were stored in separate files.

Format

The Model Advisor report format now uses indenting and italics to make it easier to assess the results of an analysis.

Preferences dialog box

From the Model Editor, select Analysis > Model Advisor > Preferences to open the Model Advisor Preferences dialog box. Alternately, in the Model Advisor window, select Settings > Preferences.

  • From Default Mode, select Model Advisor or Model Advisor Dashboard to specify the interface that you want to use.

  • Select Show Accordian for entry points to other Advisors from the Model Advisor window.

To display additional information about the checks in the Model Advisor window, select:

  • Show By Product Folder for checks available for each product.

  • Show By Task Folder for checks related to specific tasks.

  • Show Source tab for check Title, TitleID, and location of the MATLAB source code for the check.

  • Show Exclusion tab for checks that are excluded from the Model Advisor analysis.

By Product folder not displayed

By default, in the Model Advisor window, the By Product folder is not displayed. To display checks in the By Product folder, in the Model Advisor window, select Settings > Preferences. In the Model Advisor Preferences dialog box, select Show By Product Folder.

R2012b

New Features, Bug Fixes, Compatibility Considerations

New Simulink Editor

Tabbed windows and automatic window reuse to minimize window clutter

By default, the Simulink Editor uses:

  • One window to display a model and its subsystems

  • The same tab for each system that you open in a model

For example, if you open the f14 model and then open the Controller subsystem, the Simulink Editor reuses the window and tab.

Window reuse and tabs:

  • Conserve desktop space

  • Keep the display of systems in a model together

  • Provide easy navigation between systems in a model

To override the default window reuse behavior for a specific subsystem, right-click the subsystem and select either Open in New Tab or Open in New Window.

For more information, see Window Management.

Compatibility Considerations

The window display behavior for models created before R2012b remains the same in R2012b as it was in earlier releases. For example, if opening a model in an earlier release (such as R2011a) opened three Simulink Editor windows, then when you open that same model in R2012b, three Simulink Editor windows also open.

However, if you open an earlier model that has a callback that opens a subsystem, by default the subsystem opens in the same Simulink Editor window that is used for the model. If you want the callback to open a separate window for the subsystem, include an open_system call that uses the new window argument.

Smart signal routing that determines the simplest signal line path without overlapping blocks

When you draw lines to connect blocks, the Simulink Editor automatically routes the line to avoid other blocks and to minimize diagram clutter. You can manually modify the routing.

For more information, see Connect Blocks.

Explorer bar to help with navigating through a model

The Explorer bar in the Simulink Editor provides a breadcrumb that shows the nested path for the currently open system.

Select a system in the breadcrumb to open that system in the model window. If you click in the Explorer bar whitespace, you can edit the hierarchy. Also, the down arrow at the right side of the Explorer bar provides a model display history.

Simulation stepper to simulate and rewind a model one step at a time

With the new simulation stepper, you can:

  • Step forward and back in time during a simulation

  • Set time breakpoints

  • Set conditional breakpoints on a scalar signal

For more information, see Simulation Stepping.

Ability to comment out blocks

Comment out blocks in your model if you want to exclude them during simulation. To exclude a block, right-click the selected block and select Comment out.

Commenting out blocks can be useful for several tasks, including to:

  • Incrementally test parts of a model under development

  • Debug a model without having to delete and restore blocks between simulation runs

  • Test and verify the effects of certain model blocks on simulation results

  • Improve simulation performance

Subsystem badges to identify and look under masked subsystems

Identify masked subsystems by the badge that appears in the lower-left corner of the mask ( ). Click this badge to open the mask.

    Note:   The badge does not appear for masks of library links if the library is locked or its LockLinksToLibrary property is set to true.

Reorganized menu to fit common Model-Based Design workflow

The new Simulink Editor provides a top-level menu structure that reflects the steps of the model-based design process that you perform in the Simulink environment. The process is iterative and involves using different menus in different orders. The following table indicates the main menus associated with each Model-Based Design step.

Model-Based Design StepCorresponding Menus
Build the Simulink block diagram.
  • File

  • Edit

  • View

  • Diagram

Run the simulation.

Simulation

Validate the simulation results.
  • View

  • Display

  • Analysis

The Help and Tools menus provide information and tools that apply throughout the steps of the process.

The Code menu provides options relating to code generation.

For more information, see Simulink Editor.

Compatibility Considerations

The names and menu paths for some menu items have changed from what they were in the R2012a Simulink Editor. For a summary of the changes to menus, keyboard and mouse shortcuts, badges, and Simulink preferences, see Simulink Editor Changes.

Palette for commonly used actions

You can use a palette of icons (to the left of the canvas area) to perform common actions, such as adding annotations or marquee zooming.

Panning and zooming

Pan through a model by pressing the mouse scroll wheel and dragging the mouse or by pressing the space bar while dragging the mouse. Zoom using the mouse scroll wheel. To change the default action of the mouse scroll wheel, use Simulink preferences.

For more information, see Zoom and Pan Block Diagrams.

Display of overlapping blocks

Control which block appears on top, when there are overlapping blocks. From a block context menu, select Arrangeand then choose either Bring To Front or Send to Back. (In the R2012a Simulink Editor, Simulink automatically set the display order, based on alphabetical order of the block name.)

Unification of Simulink and Stateflow Editors

The Simulink and Stateflow Editors now share most menu items. Additional aspects of the editor unification include:

  • Unified canvas: Edit models and Stateflow charts in the same window.

  • Unified Model Browser tree: Model Browser tree shows complete hierarchy, including Stateflow.

Also, you can now access the same editor functionality on Windows, UNIX®, and Mac platforms.

Simulink Editor preferences

The Simulink Preferences dialog box now includes preferences to control the look and behavior of the Simulink Editor. For example, you specify how the scroll wheel behaves, the look of the diagram (the diagram theme), and the toolbar configuration at a specific level (for example, whether or not to display the Simulation toolbar).

To access the Simulink Editor preferences from the Simulink Editor, select File > Simulink Preferences > Editor Defaults. To access those preferences from the Library Browser, select File > Preferences > Editor Defaults.

Compatibility Considerations

The following R2012a preferences do not appear in R2012b:

  • Window reuse

  • Display Defaults for New Models > Browser visible

In the new Simulink Editor, you can control these editor behaviors directly from within the editor. For details, see Simulink Preferences Changes.

Toolbar and status bar control

You can control the hiding or displaying of toolbars and the status bar by using Simulink Editor Default preferences. These preferences persist across editor sessions.

Compatibility Considerations

The model parameters StatusBar and ToolBar have no effect in the Simulink Editor. These parameters will be removed in a future release.

Visual editing based on model objects

The Simulink Editor provides tools such as smart guides and automated line routing that work based on the relative locations of model objects. This approach replaces pixel-oriented visual editing.

Compatibility Considerations

The model parameters GridSpacing and ShowGrid have no effect in the Simulink Editor. These parameters will be removed in a future release.

Improved callback error handling

When an interactive operation triggers a callback that causes an error in MATLAB, Simulink:

  • Undoes the operation

  • Issues an error message

Compatibility Considerations

Before R2012b, for an interactive operation that triggered a callback error in MATLAB, Simulink reported a warning (not an error), even though Simulink stopped the callback operation at the point of failure.

Simulink Editor Changes

Mapping from R2012a Simulink Editor to the New Simulink Editor

The following tables list the new Simulink Editor menu bar items that are different from the R2012a Simulink Editor.

The tables do not include menu bar items that:

  • Have not changed

  • Appear only in the new Simulink Editor

The arrows (>) indicate nested menu paths.

File Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Preferences

File > Simulink Preferences and File > Stateflow Preferences.

Export to Web

File > Export Model to Web.

Print Details

File > Print > Print Details.

Print Setup

File > Print > Printer Setup.

Enable Tiled Printing

File > Print > Enable Tiled Printing.

Edit Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Copy Model to Clipboard

Edit > Copy Current View to Clipboard (copies the open Model Editor window contents to the clipboard).

Create Subsystem

Diagram > Subsystem & Model Reference > Create Subsystem from Selection.

Create Mask

If the block is not already masked, the dynamic menu path is Diagram > Mask > Create Mask.

If the block is already masked, the dynamic menu path is Diagram > Mask > Edit Mask.

Look Under Mask

Diagram > Mask > Look Under Mask.

Link Options

Diagram > Library Link.

Links and Model Blocks > Refresh

Diagram > Subsystem & Model Reference > Refresh Selected Model Block or, for library links, Diagram > Refresh Blocks.

Links and Model Blocks > Model Block Normal Mode Visibility

Diagram > Subsystem & Model Reference > Model Block Normal Mode Visibility.

Update Diagram

Simulation > Update Diagram..

View Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Back

Forward

Go To Parent

Access each option using View > Navigate .

Go To Parent changed to Up to Parent.

Model Browser Options

View > Model Browser.

Block Data Tip Options

Display > Blocks > Tool Tip Options.

The submenu item Block Description changed to Description.

Requirements

View > Requirements at This Level.

Signal Hierarchy

Diagram > Signals & Ports > Signal Hierarchy.

Sample Time Legend

Display > Sample Time > Sample Time Legend.

Zoom In

Zoom Out

Fit System To View

Normal (100%)

Access each option using View > Zoom.

Fit System to View changed to Fit to View.

Normal (100%) changed to Normal View (100%).

Show Page Boundaries

File > Print > Show Page Boundaries.

Port Values submenus, such as Show When Hovering

Display > Data Display in Simulation.

Highlight/Remove Highlighting

Display > Highlight Signal to Source or Display > Highlight Signal to Destination or Display > Remove Highlighting.

Simulation Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Configuration Parameters

Simulation > Model Configuration Parameters.

Normal

Accelerator

Rapid Accelerator

Software-in-the-Loop (SIL)

Processor-in-the-Loop

External

Access each option using Simulation > Mode.

Start

Simulation > Run.

Format Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Font

Diagram > Format > Font Style.

On Mac platforms, supported fonts must be in both the X11 and Mac font manager.

Text Alignment

Enable TeX Commands

Access each option using Diagram > Format.

Show Name

Diagram > Format > Show Block Name.

Show Drop Shadow

Diagram > Format > Block Shadow.

Show Port Labels

Diagram > Format > Port Labels.

Foreground Color

Background Color

Access each option using Diagram > Format.

Screen Color

Diagram > Format > Canvas Color.

Show Smart Guides

View > Smart Guides.

Align Blocks

Distribute Blocks

Resize Blocks

Access using block alignment, distribution, and resizing options using Diagram > Arrange.

Flip Name

Diagram > Rotate & Flip > Flip Block Name.

Flip Block

Diagram > Rotate & Flip > Flip Block.

Rotate Block

Access block rotation options using Diagram > Rotate & Flip.

Port/Signal Displays

Access most port and signal display options using Display > Signals & Ports.

Signal Resolution Indicators changed to Signal to Object Resolution Indicator.

Block Display > Sorted Order

Display > Blocks > Sorted Execution Order.

Block Display > Model Block Version

Display > Blocks > Block Version for Referenced Models.

Block Display > Model Block I/O Mismatch

Display > Blocks > Block I/O Mismatch for Referenced Model.

Block Display > Execution Context Indicator

Display > Blocks > Sorted Execution Order.

Library Link Display

Access library link display options using Display > Library Links.

Sample Time Display

Access sample time options using Display > Sample Time.

None changed to Off.

Tools Menu

The tools that appear in the Tools menu and other menus reflect the products for which you have a license.

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Compare Simulink XML Files

Control Design

Coverage Settings

Design Verifier

Fixed-Point Tool

Model Advisor

Model Dependencies

Parameter Estimation

Profiler

Requirements

Access these tools using Analysis.

The menu text for these items has changed:

  • Coverage Settings changed to Coverage.

  • Fixed-Point changed to Fixed Point Tool (i.e., there is no hyphen now)

  • Model Dependencies > View/Edit Manifest Contents changed to Model Dependencies > Edit Manifest Contents.

  • Profiler changed to Show Profiler Report.

Simulink Debugger

Simulation > Debug > Debug Model.

Bus Editor

Lookup Table Editor

Access these tools using Edit.

Inspect Logged Signals

Simulation > Output > Simulation Data Inspector.

Signal & Scope Manager

Diagram > Signals & Ports > Signal & Scope Manager.

Code Generation

External Mode Control Panel

HDL Code Generation

Simulink Code Inspector

Verification Wizards

Access these options using Code.

Code Generation changed to C/C++ Code.

HDL Code Generation changed to HDL Code.

Define Data Classes

Data Object Wizard

Access these options using Code > Data Objects.

Define Data Classes changed to Design Data Classes.

Response Optimization

Analysis > Response Optimization.

Help Menu

R2012a Simulink Editor Menu Bar ItemNew Simulink Editor Equivalent

Using Simulink

Help > Simulink > Simulink Help.

Blocks

Blocksets

Help > Simulink > Blocks & Blocksets Reference.

Block Support Table

Help > Simulink > Block Data Types & Code Generation Support.

Shortcuts

Help > Keyboard Shortcuts.

S-Functions

Help > Simulink > S-Functions.

Demos

Help > Simulink > Examples and Help > Stateflow > Examples.

About Simulink

Help > About > Simulink.

Simulink Editor Context Menu Changes

From the Canvas

R2012a Simulink Editor Context MenuNew Simulink Editor Equivalent

Back

Forward

Go to Parent

Not available from context menu.

From the menu bar, select the appropriate menu item from View > Navigate.

Configuration Parameters

Model Configuration Parameters.

Format > Wide Nonscalar Lines

Format > Signal Dimensions

Format > Port Data Types

Access these options using Display > Signals & Ports.

Link Options

Not available from the canvas context menu.

Access either from a block context menu or from the menu bar, using Diagram > Library Link.

Requirements

Requirements at This Level.

Screen Color

Canvas Color.

Signal & Scope Manager

Not available from context menu.

From the menu bar, use Diagram > Signals & Ports > Signal & Scope Manager.

Fixed-Point Tool

Fixed Point Tool.

From a Block

R2012a Simulink Editor Context MenuNew Simulink Editor Equivalent

Block Properties

Properties.

Foreground Color

Background Color

Access these options using Format.

Convert to Model Block (for Subsystem block context menu)

Subsystem & Model Reference > Convert Subsystem to > Referenced Model.

Format > Flip Block

Format > Flip Name

Format > Rotate Block

Access these options using Rotate & Flip.

Format > Font

Format > Font Style.

Format > Show Drop Shadow

Format > Block Shadow.

Format > Show Name

Format > Show Block Name.

Format > Show Port Labels

Format > Port Labels.

HDL Code Generation

HDL Code.

Link Options

Not available from context menu.

From the menu bar, use Diagram > Library Link.

Mask Subsystem

If the block is not already masked, the dynamic menu path is Mask > Create Mask.

If the block is already masked, the dynamic menu path is Mask > Edit Mask.

Look Under Mask

Mask > Look Under Mask.

Port Signal Properties

Signals & Ports.

Signal & Scope Manager

Not available from context menu.

From the menu bar, use Diagram > Signals & Ports > Signal & Scope Manager.

Create Subsystem

Subsystem & Model Reference > Create Subsystem from Selection.

Code Generation > Generate Protected Model (from a Model block)

From a Model block: C/C++ Code > Generate Protected Model

Note that you can also access this option from the main menu: Code > C/C++ Code > Generate Protected Model.

Refresh (from a Model block)

Subsystem & Model Reference > Refresh Selected Model Block

From a Signal

R2012a Simulink Editor Context MenuNew Simulink Editor Equivalent

Connect to Existing Viewer

Connect to Viewer.

Disconnect & Delete Viewer

Use a combination of Disconnect Viewer and Delete Viewer.

Fixed-Point Tool

Not available from context menu.

From the menu bar, use Analysis > Fixed Point.

Highlight to Source

Highlight to Destination

Highlight Signal to Source.

Highlight Signal to Destination.

Linearization Points

Linear Analysis Points.

Simulink Editor Mouse and Keyboard Shortcut Changes

Mouse Scroll Wheel

By default, in the new Simulink Editor, rolling the mouse scroll wheel up zooms in on a model, and rolling the wheel down zooms out.

To scroll left and right using the mouse scroll wheel, press Shift while rolling the wheel. To scroll up and down, press Ctrl while rolling the wheel.

You can change the default scroll wheel behavior. In the Simulink Preferences dialog box, clear Editor Defaults > Scroll wheel controls zooming.

Model Viewing Shortcuts

Task R2012a Simulink Editor ShortcutNew Simulink Editor Equivalent

Zoom in

r

Use the mouse scroll wheel or Ctrl++ (the plus sign)

Zoom out

v

Use the mouse scroll wheel or Ctrl+- (the minus sign).

Zoom to normal view

1

Alt+1

Pan left

d or Ctrl+Left Arrow

If scroll bars are visible, then with nothing selected, use Shift+Left Arrow or for finer panning, just the Left Arrow.

Pan right

g or Ctrl+Right Arrow

If scroll bars are visible, then with nothing selected, use Shift+Right Arrow or for finer panning, just the Right Arrow.

Pan up

e or Ctrl+Up Arrow

If scroll bars are visible, then with nothing selected, use Shift+Up Arrow or for finer panning, just the UpArrow.

Pan down

c or Ctrl+Down Arrow

If scroll bars are visible, then with nothing selected, use Shift+Down Arrow or for finer panning, just the Down Arrow.

Fit selection to screen

f

You can also use marquee zoom to fit a selection to the screen.

Block Editing Shortcuts

Task R2012a Simulink Editor ShortcutNew Simulink Editor Equivalent

Move a block from one model to another model

Shift, press the left mouse button, and drag block to different model. The block is disconnected moved from the source model to the other model.

In the new Simulink Editor, Shift, press the left mouse button, and drag block to different model copies the block, but does not remove it from the source model.

Line Editing Shortcuts

Task R2012a Simulink Editor ShortcutNew Simulink Editor Equivalent

Create line segments

Move the cursor to the end of line and drag the line.

New Simulink Editor performs autorouting. You can manually control the line segment by clicking the arrow guides.

The arrow guides appear when you edit a previously disconnected signal from its endpoint. During new line creation, let go of the mouse button and then move it off the newly created endpoint.

Create diagonal line segments

Click anywhere on a line, Shift, and move the cursor.

For an existing line, click a bend (corner) or solder (joint) point, Shift, and move the cursor. For new lines, use Shift and the arrow guides.

Signal Label Editing Shortcuts

Task R2012a Simulink Editor ShortcutNew Simulink Editor Equivalent

Delete signal label

Shift and click label. Then press Delete.

Right-click the label and from the context menu, select Delete Label.

Annotation Editing Shortcuts

Task R2012a Simulink Editor ShortcutNew Simulink Editor Equivalent

Delete annotation

Shift and select annotation. Then press Delete.

Right-click the annotation and from the context menu, select Delete.

Simulink Editor Badges Changes

Badges are the icons that appear in the Simulink Editor to provide information about how you have configured a model.

BadgeR2012a Simulink Editor BadgeNew Simulink Editor Badge

Signal viewer

Library link active

Library link inactive

Library link locked

Library link parameterized

Model protected

Simulink Preferences Changes

Two R2012a Simulink preferences no longer appear in R2012b. In the new Simulink Editor, you can control these editor behaviors directly from within the editor.

R2012a Simulink PreferenceNew Simulink Editor Equivalent

Window reuse

The Simulink Editor opens subsystems in the same window that it uses for the model that contains the subsystem. There is no global setting to change that behavior. However, you can control the window and tab behavior when opening a specific subsystem. For details, see Navigate Model Hierarchy.

Browser visible

To display or hide the Model Browser, select or clear the View > Model Browser > Show Model Browser option.

Also, the MATLAB Preferences dialog box Figure Copy Template > Copy Options preferences no longer apply to copying a model from the clipboard to a third-party application.

Simulink and Stateflow Editor Customization Changes

Customizing the new Simulink and Stateflow editors is as it was in R2012a, with the following exceptions:

  • The addition of custom menu functions to the ends of top-level menus depends on the active editor:

    • Menus bound to Simulink:FileMenu only appear when the Simulink Editor is active.

    • Menus bound to Stateflow:FileMenu only appear when the Stateflow Editor is active.

    • To have a menu to appear in both of the editors, call addCustomMenuFcn twice, once for each tag. Check that the code works in both editors.

  • If a filter is applied to the Simulink tag, then a menu item that existed in Simulink and Stateflow editors in R2012a is filtered, regardless of the active editor type. However, if the filter is applied to the Stateflow tag, then the menu item is only filtered in the Stateflow Editor.

  • If a menu item tag has changed in R2012b, you do not need to change the tag to the R2012b tag.

For more information about customizing menus, see Add Items to Model Editor Menus and Disable and Hide Model Editor Menu Items.

Connection to Educational Hardware

Support for Arduino and PandaBoard hardware

Support for Arduino Mega 2560 and Arduino Uno hardware

Run Simulink models on Arduino Mega 2560 and Arduino Uno hardware. For more information, see the Arduino topic.

To use this capability, first run Target Installer and install support for Arduino hardware. To run Target Installer, enter targetinstallertargetinstaller in the MATLAB Command Window.

After installing support, you can use the Simulink "Target for Use with Arduino Hardware" block library. To open this block library, enter arduinolib in the MATLAB Command Window.

This block library contains the following blocks:

After you install support, Target Installer displays the following examples:

  • Getting Started with Arduino Hardware

  • Communicating with Arduino Hardware (Arduino Mega 2560 only)

  • Servo Control

  • Drive with PID Control

Support for PandaBoard hardware

Run Simulink models on PandaBoard hardware. For more information, see the PandaBoard topic.

To use this capability, first run Target Installer and install support for PandaBoard hardware. To run Target Installer, enter targetinstallertargetinstaller in the MATLAB Command Window.

After installing support, you can use the Simulink "Target for Use with PandaBoard Hardware" block library. To open this block library, enter pandaboardlib in the MATLAB Command Window.

This block library contains the following blocks:

Bluetooth download to LEGO MINDSTORMS NXT hardware

You can use a Bluetooth® connection instead of a USB cable to download a Simulink model from your host computer to the LEGO MINDSTORMS NXT hardware. Previously, a USB cable was the only connection available for downloading models to the NXT hardware. For more information, see:

Performance

Simulation Performance Advisor that analyzes your model and provides advice on how to increase simulation performance

Use the Performance Advisor to check models for conditions and configuration settings that can result in inefficient simulation of the system that the model represents. The Performance Advisor produces a report that lists the suboptimal conditions or settings that it finds, suggesting better model configuration settings where appropriate. It also provides mechanisms for automatically fixing warnings and failures or allowing you to fix them manually. For more information, see Consult the Performance Advisor.

Project and File Management

Simulink default file format SLX that uses the OPC standard

In R2012b, Simulink has a new default file format for models, SLX, with the file extension .slx. In R2012a, SLX was available as an option.

The SLX file format contains the same information as an MDL file and is a compressed package that conforms to the Open Packaging Conventions (OPC) interoperability standard. SLX stores model information using Unicode UTF-8 in XML and other international formats.

Saving Simulink models in the SLX format:

  • Typically reduces file size. The file size reduction between MDL and SLX varies depending on the model.

  • Solves some problems in previous releases with loading and saving MDL files containing Korean and Chinese characters.

  • Supports new features in future releases not supported with MDL format.

You can still choose to save model files as MDL, and the MDL format will remain available for the foreseeable future.

For more information, see Saving Models in the SLX File Format.

Compatibility Considerations

If you upgrade an MDL file to SLX file format, the file contains the same information as the MDL file, and you always have a backup file. All functionality and APIs that currently exist for working with models, such as the get_param and set_param commands, are also available when using the SLX file format.

The MDL file format will continue to be supported, but, after R2012b, new features might be available only if you use the SLX file format.

The new file extension .slx might cause compatibility issues if your scripts contain hard-coded references to file names with extension .mdl. To check for problems, verify that your code works with both the MDL and SLX formats. If you find any places in your scripts that need to be updated, use functions like which and what instead of strings with .mdl.

    Caution   If you use third-party source control tools, be sure to register the model file extension .slx as a binary file format. If you do not, these third-party tools might corrupt SLX files when you submit them.

Operations with Possible Compatibility ConsiderationsWhat Happens Action
Hard-coded references to file names with extension .mdl. Scripts cannot find or process models saved with new file extension .slx. Make your code work with both the .mdl and .slx extension.
Use functions like which and what instead of strings with .mdl.
Third-party source control tools that assume a text format by default. Binary format of SLX files can cause third-party tools to corrupt the files when you submit them. Register .slx as a binary file format with third-party source control tools.

The format of content within MDL and SLX files is subject to change. Use documented APIs (such as get_param, find_system and Simulink.MDLInfo) to operate on model data.

Simulink Upgrade Advisor to help migrate files to the current release

Use the Upgrade Advisor for help with using the current release to upgrade and improve models.

The Upgrade Advisor identifies cases where you can benefit by changing your model to use new features and settings in Simulink. The Advisor provides advice for transitioning to new technologies and upgrading a model hierarchy.

The Upgrade Advisor also identifies cases when a model will not work because changes and improvements in Simulink require changes to a model.

The Upgrade Advisor offers options to perform recommended actions automatically or instructions for manual fixes.

Built-in SVN adapter for Simulink Projects that provides connectivity to SVN and support for server-based repositories

Simulink Projects now provide built-in Subversion source control integration, reducing setup and providing faster performance and improved support for connecting to servers. You can now connect to servers that require login.

Previously, you had to install an additional command-line SVN client to use Projects with SVN. Now you can use SVN for project source control with no additional installation steps.

Simulink Project Tool dependency graph that provides highlights by file type, dependency type, and label

After you run dependency analysis on your project, you can use the Graph view to examine dependencies for impact analysis. You can now highlight dependencies by file type, dependency type, and file labels. For example, you might want to highlight model files and see which have the label To Review. Previously, you could highlight only upstream and downstream dependencies of the selected file. Now you can also highlight circular dependencies.

You can now also perform file operations in the Graph view, such as Open, Add to Project, Add Label, and Remove from Project. File operations can be useful when using the graphical dependency view to identify required changes to your project, such as identifying files that need removing or files that share a common label.

The Dependencies results list and Graph view are now separate tree node views for efficient workflow, instead of tabs within the Dependency Analysis view. These views also now display a time stamp to identify when the analysis was performed.

Redesigned graphical tool for efficient Simulink Projects workflow

The Simulink Project Tool is redesigned for more efficient workflow and access to tools.

  • Simulink Projects are integrated with the MATLAB Toolstrip when you dock the tool, with new options to create and open recent projects from MATLAB.

  • The toolstrip contains components that were previously available in menus and toolbars.

  • All project views have new tools for improved browsing, searching, and filtering.

  • There are new tree nodes for accessing the batch processing, dependency results, and dependency graph views.

  • The new source control pane provides access to configuration management tasks and more space in other views.

  • New archive options include the capability to create a new project from a zip archive.

  • New project integrity checks assist with MDL to SLX upgrades, check for slprj folders added to projects, and provide Fix buttons for tasks that can be automated.

Batch operation support for files in a Simulink Project

The Simulink Project Tool has a new Batch Job view to help you create and run functions on selected project files. Batch tools provide guidance for creating your own batch functions. An example batch job function identifies and saves any model files that contain unsaved changes.

Create and open recent Simulink Projects from MATLAB

The MATLAB Toolstrip has new options to create Simulink Projects and open recent projects direct from the MATLAB Desktop.

Simulink Projects are integrated with the MATLAB Toolstrip when you dock the tool.

Block Enhancements

Menu item to convert configurable and normal subsystems to variant subsystems

Previously, to convert configurable or normal subsystems to variant subsystems, you had to create a new variant subsystem in your model and manually modify it to match the subsystem you were converting.

That method was error-prone. Manually matching a variant subsystem and its ports to the converted subsystem was also a time-consuming process. Moreover, configurable subsystems will not be supported in a future release.

In this release, you can do this conversion by right-clicking a subsystem and selecting Subsystems and Model Reference > Convert Subsystem To > Variant Subsystem.

Simulink creates a new variant subsystem and an appropriate number of inports and outports that match the converted subsystem.

Masking improvements, including the ability to reuse masks, delete existing masks on blocks, and use the shortcut operator || in mask callback code

Use classes Simulink.Mask and Simulink.MaskParameter to control masks programmatically. With these classes, you can perform the following mask operations:

  • Create, copy, and delete masks

  • Add, edit, and delete mask parameters

  • Get mask owner and set properties for masks and mask parameters

In addition, in this release, you can use the OR operator ||, which was previously prohibited, in mask callback code.

Default output data type of Logic blocks changed to boolean

The following blocks now use a default value of boolean for Output data type. In previous releases, the blocks used uint8 as the default output data type.

Signal Attributes tab of dialog box for Operator blocks renamed to Data Type

For the Logical Operator and Relational Operator blocks, the name of the Signal Attributes tab of the block dialog box has changed to Data Type.

Parameter name changes for Unit Delay block

For the Unit Delay block, the following parameters have been renamed:

Old NameNew Name
X0InitialCondition
StateIdentifierStateName
RTWStateStorageClassCodeGenStateStorageClass
RTWStateStorageTypeQualifierCodeGenStateStorageTypeQualifier

New variants of Delay block in Discrete library

The Discrete library now contains the following additional variants of the Delay block:

  • Variable Integer Delay block

  • Resettable Delay block

You can configure the Delay block to work in the same way as either of these variants.

With the source of the delay length set to Input port, the Delay block works as a Variable Integer Delay block.

To configure the Delay block to have a resettable delay, set the source of the initial condition to Input port and the external reset algorithm to Rising.

Some Probe block parameters no longer support boolean data type

The following parameters of the Probe block no longer support the boolean data type:

  • Data type for width

  • Data type for sample time

  • Data type for signal dimensions

If the width, sample time, or dimensions of the input signal has a value greater than zero, the boolean data type implicitly represents the output as 1, which is not a useful result. Setting any of the listed parameters to Same as input while the block's input signal data type is boolean results in a simulation error.

Internationalization of block dialog box titles and buttons and block tooltips

To enable translation in localized versions of the Simulink software, in this release, the following items relating to Simulink blocks were internationalized:

  • Titles of block dialog boxes

  • Text for block tooltips

As a result of these changes, in the Japanese version of Simulink, and in future localized versions of the product, these items will display in translated form.

Enabled and triggered subsystems

For triggered and enabled subsystems, the Simulink software now performs zero-crossing detection and zero-crossing state updates of the trigger port outside the enable check.

In previous releases, for triggered and enabled subsystems, the Simulink software performed zero-crossing detection and zero-crossing state updates of the trigger port inside the enable check. This behavior sometimes caused simulation and code generation data mismatches.

Data Management

Variable Editor access from within Model Explorer

In the Model Explorer Contents pane, you can use the Variable Editor to edit variables from the MATLAB workspace or model workspace. The Variable Editor is available for editing large arrays and structures.

To open the Variable Editor for a variable that is an array or structure:

  1. Click the Value cell for the variable.

  2. Select the Variable Editor icon.

The Variable Editor opens:

You can resize and move the Variable Editor. The Contents pane reflects the edits that you make in the Variable Editor.

For details, see Editing Workspace Variables.

Logged simulation data from Simulation Data Inspector accessible from Simulink toolbar

The record button for the Simulation Data Inspector tool is now accessible on the Simulink toolbar. Previously, the record button was a global setting for all models. The record button now applies per model. Click the record button to select it and then simulate the model to record and inspect logged signal data. You can open the Simulation Data Inspector tool by clicking the down arrow and selecting Open Simulation Data Inspector. For more information, see Record Simulation Data.

Compatibility Considerations

The record button no longer appears on the Simulation Data Inspector tool.

Specify verifySignalAndModelPaths action

You can specify the action that the verifySignalAndModelPaths method of the signal logging class Simulink.SimulationData.ModelLoggingInfo takes when it detects an invalid path.

Import and map data to root-level input ports

The Configuration Parameters dialog box Data Import/Export > Input parameter now has an Edit Input button. Use this button to start the Root Inport Mapping tool. This tool lets you import data from a MAT-file and automatically map that data to root-level input ports. For more information, see Import and Map Data to Root-Level Inports.

Dataset signal logging format for increased flexibility and ease of use

The default format for saving signal logging data is now Dataset.

With the Dataset format, you can do the following tasks, which you cannot do with the previous default format of ModelDataLogs:

  • Work with logging data in MATLAB without a Simulink license

  • Log multiple data values for a given time step, which can be important for Iterator subsystem and Stateflow signal logging

  • Easily analyze logged signal data for models with deep hierarchies, bus signals, and signals with duplicate or invalid names

  • Avoid the limitations of the ModelDataLogs format, which Bug Report 495436 describes.

To specify the signal logging format, use the Configuration Parameters > Data Import/Export > Signal logging format parameter. For more information, see Specify the Signal Logging Data Format.

Compatibility Considerations

Before R2012b, the default signal logging format was ModelDataLogs. In R2012b, the default format is Dataset. The ModelDataLogs format will be removed in a future release.

In R2012b, Simulink displays a warning if you run a model that meets both of the following conditions:

  • The Configuration Parameters > Data Import/Export > Signal logging format parameter is set to ModelDataLogs.

  • The model has signal logging enabled for at least one signal or uses signal viewer scopes.

Use the Upgrade Advisor to upgrade a model to use Dataset format, using one of these approaches:

  • In the Simulink Editor, select Analysis > Model Advisor > Upgrade Advisor

  • From the MATLAB command line, use the upgradeadvisor function.

For more information about how to update models to use Dataset, including how to address issues that you might encounter after converting a model to use Dataset format, see Migrate from ModelDataLogs to Dataset Format.

Data type field displays user-defined data types

Previously, the data type fields in dialog boxes for various data entities such as data objects and blocks displayed only built-in data types. For mpt signal and parameter objects, you could customize this list to include user-defined data types. For this customization, you had to modify the Simulink customization file sl_customization.m to add user-defined data types to the list.

In R2012b, the data type field displays both user-defined and built-in data types, provided these user-defined data types exist in the base workspace. This enhancement is not restricted to mpt data objects. All dialog boxes that contain the data type field will display user-defined data types.

Any modifications you make to sl_customization.m in order to display user-defined data types will still be supported.

Simulink.VariableUsage to get variable information

In R2012b, use Simulink.VariableUsage to determine which blocks use a variable defined in the model, mask, or base workspace.

Previously, you used Simulink.WorkspaceVar to get this information.

Compatibility Considerations

Simulink.WorkspaceVar will not be supported in a future release. If you use Simulink.WorkspaceVar in your code to programmatically get variable information, replace it with Simulink.VariableUsage.

Customizable line specification in Simulation Data Inspector

In the Simulation Data Inspector tool, the line specification includes customizable color selection and more marker specifiers for plotting data points. To view the line specification, in the Signal Browser table, click the Line column of a signal. For more information, see Specify the Line Configuration.

Simulation Data Inspector report includes harness model information

A Simulation Data Inspector report of a recorded simulation of a Simulink Verification and Validation harness model now includes model information and a model diagram of the system under test and the test harness model. For more information on generating a report, see Create Simulation Data Inspector Report.

Component-Based Modeling

Model configuration for targets with multicore processors

This capability has the following changes:

  • Models configured for concurrent execution can now contain blocks that require implicit ODE solvers, such as physical modeling blocks. In previous releases, models that contained such blocks returned an error message during simulation and code generation.

  • Code generation for models configured for concurrent execution, and which contain a large number of continuous states, now have improved performance and decreased memory usage.

New Simulink.GlobalDataTransfer class

To configure data transfers for models configured for concurrent execution, use the Simulink.GlobalDataTransfer class. This class contains the properties:

  • DefaultTransitionBetweenSyncTasks

  • DefaultTransitionBetweenContTasks

  • DefaultExtrapolationMethodBetweenContTasks

  • AutoInsertRateTranBlk

To access the properties of this class, use the get_param function to get the handle for this class, then use dot notation to access the properties, for example:

dt=get_param(gcs,'DataTransfer');
dt.DefaultTransitionBetweenContTasks

ans =

Ensure deterministic transfer (minimum delay)

Reduced memory usage in models with many library links

Simulink now saves memory by closing partially loaded libraries on subsequent simulations. In previous releases, Simulink loaded linked blocks by partially loading their source libraries when you opened, updated, or simulated the model. These partially loaded libraries were never closed again, resulting in unnecessary memory use. Now Simulink closes partially loaded libraries once they are no longer needed, after loading the linked blocks. Reducing memory use can increase performance in large models with many library links.

Compatibility Considerations

If you have scripts that assume libraries are loaded and try to access the library, these scripts will now produce errors. You must update scripts to load libraries using load_system before running commands such as set_param on a library.

Configuration Reference dialog box to propagate and undo configuration settings to all referenced models

To share a configuration reference among referenced models in a model hierarchy, the Configuration Reference Propagation dialog box provides:

  • A list of referenced models in the top model

  • The ability to select only specific referenced models for propagation

  • After propagation, a display of the status for the converted configuration for each referenced model

  • The ability to undo the configuration reference and restore the previous configuration settings for a referenced model

Context-dependent function-call subsystem input handling improved

Executing a function-call subsystem that has context-dependent inputs can result in nondeterministic simulation results. Detecting dependent input at simulation time helps to avoid unexpected code generation results.

Before R2012b, if you wanted Simulink to flag such cases as errors, you needed to set the HiliteFcnCallInpInsideContext model parameter each time you load the model. You could not save the setting for that parameter in the model.

In R2012b, to generate an error whenever Simulink has to compute any of a function-call subsystem's inputs directly or indirectly during execution of the function-call subsystem, you can use the new FcnCallInpInsideContextMsg parameter argument setting of EnableAllAsError. The parameter setting is stored with the model. Set the FcnCallInpInsideContextMsg parameter with the Configurations Parameters > Diagnostics > Connectivity > Context-dependent inputs parameter.

Compatibility Considerations

In R2012b, the HiliteFcnCallInpInsideContext parameter has been removed. The new FcnCallInpInsideContextMsg parameter settings eliminate the need for the HiliteFcnCallInpInsideContext parameter, which you could not store with the model.

In R2012b, the FcnCallInpInsideContextMsg parameter setting of Enable All argument has been replaced by two settings: EnableAllAsWarning and EnableAllAsError. The EnableAllAsError setting is now the default. In R2012a and R2011b, Enable All was the default, and in R2011a and earlier, Use local settings was the default.

If you have existing code that set the HiliteFcnCallInpInsideContext parameter, you need to change that code in R2012b for the following conditions.

Existing CodeR2012b Equivalent Code

HiliteFcnCallInpInsideContext set to on

FcnCallInpInsideContextMsg set to Enable All

Set FcnCallInpInsideContextMsg to EnableAllAsError and remove HiliteFcnCallInpInsideContext.

HiliteFcnCallInpInsideContext set to off

FcnCallInpInsideContextMsg set to Enable All

Set FcnCallInpInsideContextMsg to EnableAllAsWarning and remove HiliteFcnCallInpInsideContext

FcnCallInpInsideContextMsg set to Use local settings

FcnCallInpInsideContextMsg set to UseLocalSettings

FcnCallInpInsideContextMsg set to Disable All

Set FcnCallInpInsideContextMsg to DisableAll.

    Note:   The FcnCallInpInsideContextMsg settings of Use local settings and Disable all are maintained for backward compatibility, but may be deprecated in a future release. If code from before R2012b used get_param with the FcnCallInpInsideContextMsg parameter for the string comparison, then when you run that code in R2012b, the returned results of UseLocalSettings and DisableAll no longer match the Use local settings and Disable all strings in the earlier code.

The Model Advisor Check usage of function-call connections checks based on the settings of the Configurations Parameters > Diagnostics > Connectivity > Invalid function-call connection and Configurations Parameters > Diagnostics > Connectivity > Context-dependent inputs parameters. In R2012b, the recommended action was to set Context-dependent inputs to Enable All. In R2012b, the recommended action is to set it to Enable all as errors.

When you save a model that has FcnCallInpInsideContextMsg parameter set to EnableAllAsWarning or EnableAllAsError to an earlier release, Simulink saves the earlier-release model with the Enable all setting. The EnableAllAsError behavior of generating an error message is not available in the earlier-release model.

Simulink.Variant object and the model InitFcn

Simulink.Variant objects used by a model must be created before simulation is started. If you create or update a Simulink.Variant object in the model's callback InitFcn function, then at diagram update time, Simulink ignores that object creation or update.

Compatibility Considerations

In earlier versions of Simulink, if you created or updated Simulink.Variant objects with the InitFcn function, Simulink incorrectly processed the object creation or update, which could lead to incorrect model behavior.

Signal Management

Sample time propagation changes

The way that Simulink software uses the sample time of an enable signal during sample time propagation has been improved for models that contain enabled subsystems with:

  • No Inport blocks

  • All blocks inside the enabled subsystem specifying an inherited sample time

Simulink now sets the sample times of the contents of enabled subsystems with these conditions to the sample times of their Enable blocks. In previous releases, Simulink did not propagate the sample time of the enable signal to the subsystem contents. Instead, Simulink determined the sample time of the subsystem contents using backpropagation from outside the subsystem.

Compatibility Considerations

This change helps you avoid unintentional multirate enabled subsystems. However, if existing models have Merge blocks whose inputs are driven by enabled subsystem outputs, Model Advisor checks might return errors. Follow the Model Advisor guidelines to resolve the issue.

If you want your model to behave as before, manually set the sample times in your enabled subsystems.

Signal Builder

Signal Builder has the following changes:

  • You can now import signal data formatted in a custom format to the Signal Builder block. In previous releases, you could import data only if it complied with the existing format guidelines. For more information, see Importing Data with Custom Formats.

  • The Signal Builder block has had minor graphical updates. For more information, see Signal Groups.

  • The signalbuilder function now enables you to get the active group label.

User Interface Enhancements

Model Advisor Dashboard

The Model Advisor dashboard provides a way for you to efficiently check that your model complies with modeling guidelines. You can use the Model Advisor dashboard to run a set of checks on your model without opening the Model Advisor window and reloading checks, saving analysis time. To open the Model Advisor dashboard, from the Model Editor, you can either:

  • Select Analysis > Model Advisor > Model Advisor Dashboard.

  • Select Model Advisor Dashboard from the Model Editor toolbar drop-down list.

When you use the Model Advisor dashboard, you can select and view checks by clicking the Switch to Model Advisor toggle button ( ). For more information, see Overview of the Model Advisor Dashboard.

Show partial or whole model hierarchy contents

By default, the Model Explorer displays objects for the system that you select in the Model Hierarchy pane. It does not display data for child systems.

Now you can override that default, so that the Model Explorer displays objects for the whole hierarchy of the currently selected system. To toggle between displaying only the current system and displaying the whole system hierarchy of the current system. Use one of these techniques:

  • Select View > Show Current System and Below.

  • Click the Show Current System and Below button at the top of the Contents pane.

To indicate that you have selected the Show Current System and Below option, the Model Explorer:

  • In the Model Hierarchy pane, highlights in pale blue the current system and its child systems

  • After the path in the Contents of field, includes (and below)

  • Changes the Show Current System and Below button at the top of the Contents pane and in the View menu

  • In the status bar, indicates the scope of the displayed objects when you hover over the Show Current System and Below button

Loading very large models for the current system and below can be slow. To stop the loading process at any time, either click the Show Current System and Below button or click another node in the tree hierarchy.

If you show the current system and below, you may want to change the view to better reflect the displayed system contents.

The setting for the Show Current System and Below option is persistent across Simulink sessions.

Compatibility Considerations

The Model Explorer search bar no longer provides the Search Current System and Below option. Instead, the search honors the Show Current System and Below setting that you set with the View menu or Show Current System and Below button.

Improved icons for model objects

Improved icons for model objects that the Model Explorer displays (for example, blocks, signals, variables) better represent the objects and are more consistent with icons used in other Simulink tools.

Simulink Debugger

The following capabilities are not available in the debugger. For more information on the debugger, see Introduction to the Debugger:

  • Animations

  • Adding breakpoints while in the initialization phase

  • Displaying I/O while in the initialization phase

Model Advisor Checks

Verify Syntax of Library Models

There are Model Advisor checks available to verify the syntax of library models. When you use the Model Advisor to check a library model, the Model Advisor window indicates (~) checks that do not check libraries. To determine if you can run the check on library models, you can also refer to the check documentation, in the Capabilities and Limitations section. You cannot use checks that require model compilation. If you have a Simulink Verification and Validation license, you can use an API to create custom checks that support library models.

MATLAB Function Blocks

R2012a

New Features, Bug Fixes, Compatibility Considerations

Component-Based Modeling

Interactive Library Forwarding Tables for Updating Links

Use the new Forwarding Table to map old library blocks to new library blocks. In previous releases, you could create forwarding tables for a library only at the command line. Now you can interactively create forwarding tables for a library to specify how to update links in models to reflect changes in the parameters. To set up a forwarding table for a library, select File > Library Properties.

You can also specify transformation functions to update old link parameter data using a MATLAB file on the MATLAB path. Transforming old link parameter data for the new library block enables you to load old links and preserve parameter data.

After you specify the forwarding table, any links to old library blocks are updated when you open a model containing links to the library. Library authors can use the forwarding tables to automatically transform old links into updated links without any loss of functionality and data. Use the forwarding table to solve compatibility issues with models containing old links that cannot load in the current version of Simulink. Library authors do not need to run slupdate to upgrade old links, and can reduce maintenance of legacy blocks.

For details, see Making Backward-Compatible Changes to Libraries in the Simulink documentation.

Automatic Refresh of Links and Model Blocks

When you save changes to a library block, Simulink now automatically refreshes all links to the block in open Model Editor windows. You no longer need to manually select Edit > Links and Model Blocks > Refresh. When you edit a library block (in the Model Editor or at the command line), Simulink now indicates stale links which are open in the Model Editor by showing that the linked blocks are unavailable. When you click the Model Editor window, Simulink refreshes any stale links to edited blocks, even if you have not saved the library yet.

For details, see Updating a Linked Block in the Simulink documentation.

Model Configuration for Targets with Multicore Processors

You can now configure models for concurrent execution using configuration reference objects or configuration sets. In the previous release, you could use only configuration sets. Existing configuration sets continue to work.

The workflow to configure a model for concurrent execution has these changes:

  • To preserve existing configuration settings for your model, in Model Explorer, expand the model node. Under the model, right-click Configuration, then select the Show Concurrent Execution option. This action updates the Solver pane to display a Concurrent execution options section.

  • To create new configuration settings, in Model Explorer, right-click the model and select Configuration > Add Configuration for Concurrent Execution. This action updates the Solver pane to display a Concurrent execution options section.

The following changes have also been made:

  • The Ensure deterministic transfer (minimum delay) data transfer now supports continuous and discrete signals. In the previous release, this data transfer type supported only continuous signals.

  • Data transfer has been enhanced to allow signal branch points outside of referenced models. In previous releases, signal branching was supported only within referenced models.

  • The following Simulink.SoftwareTarget.TaskConfiguration methods have new names. Use the new method names.

    Old NameNew Name
    addAperiodicTaskGroupaddAperiodicTrigger
    deleteTaskGroupdeleteTrigger
    findTaskGroupfindTrigger

  • The sldemo_concurrent_executionsldemo_concurrent_execution demo has been updated to reflect the updated software. It also now contains an example of how to configure the model for an asynchronous interrupt.

  • In the Concurrent Execution dialog box, the Map Blocks To Tasks node has changed to Tasks and Mapping. The Periodic and Interrupt nodes are now hierarchically under the Tasks and Mapping node.

MATLAB Function Blocks

Integration of MATLAB Function Block Editor into MATLAB Editor

There is now a single editor for developing all MATLAB code, including code for the MATLAB Function block.

Code Generation for MATLAB Objects

There is preliminary support in MATLAB Function blocks for code generation for MATLAB classes targeted at supporting user-defined System objects. For more information about generating code for MATLAB classes, see Code Generation for MATLAB Classes. For more information about generating code for System objects, see the DSP System Toolbox™, Computer Vision System Toolbox™, or the Communications System Toolbox™ documentation.

Specification of Custom Header Files Required for Enumerated Types

If data in your MATLAB Function block uses an enumerated type with a custom header file, include the header information in the Simulation Target > Custom Code pane of the Configuration Parameters dialog box. In the Header file section, add the following statement:

#include "<custom_header_file_for_enum>.h"

Compatibility Considerations

In earlier releases, you did not need to include custom header files for enumerated types in the Configuration Parameters dialog box.

Data Management

New Infrastructure for Extending Simulink Data Classes Using MATLAB Class Syntax

Previously, you could use only the Data Class Designer to create user-defined subclasses of Simulink data classes such as Simulink.Parameter or Simulink.Signal.

The Data Class Designer, which is based on level-1 data class infrastructure, allows you to create, modify, or delete user-defined packages containing user-defined subclasses.

In a future release, support for level-1 data class infrastructure is being removed.

There are disadvantages to using the level-1 data class infrastructure:

  • The syntax for defining data classes using this infrastructure is not documented.

  • The data classes are defined in P-code.

  • The infrastructure offers limited capability for defining data classes.

    • It does not allow you to add methods to your data classes.

    • It does not allow you to add private or protected properties to your data classes.

  • It permits partial property matching and does not enforce case sensitivity. For example, after creating a Simulink.Parameter data object

    a = Simulink.Parameter;

    you could set the property Value of the data object by using the following command:

    a.value = 5;

In R2012a, a replacement called level-2 data class infrastructure is being introduced. This infrastructure allows you to extend Simulink data classes using MATLAB class syntax.

Features of level-2 data class infrastructure:

  • Ability to upgrade data classes you defined using level-1 data class infrastructure. To learn how to upgrade, see Upgrade Level-1 Data Classes to Level-2.

  • Complete flexibility in defining your data classes, which can now have their own methods and private properties.

  • Simplified mechanism for defining custom storage classes for your data classes.

  • Strict matching for properties, methods, and enumeration property values.

  • Ability to define data classes as readable MATLAB code, not P-code. With class definitions in MATLAB code, it is easier to understand how these classes work, to integrate code using configuration management, and to perform peer code reviews.

Compatibility Considerations

When you migrate your level-1 data classes to level-2 data classes, the way that MATLAB code is generated and model files are loaded remains the same. However, you may encounter errors if your code includes the following capabilities specific to level-1 data classes:

  • Inexact property names such as a.value instead of the stricter a.Value.

  • The set method to get a list of allowable values for an enumeration property.

  • Vector matrix containing Simulink.Parameter and Simulink.Signal data objects. Previously, using level-1 data classes, you could define a vector matrix v as follows:

    a = Simulink.Signal;
    b = Simulink.Parameter;
    v = [a b];

    However, level-2 data classes do not support such mixed vector matrices.

In these cases, modify your code to replace these capabilities with those supported by level-2 data classes. For more information on how to make these replacements, see MATLAB Object Oriented Programming.

Change in Behavior of isequal

Previously, when you used function isequal to compare two Simulink data objects, the function compared only the handles of the two objects. This behavior was incorrect and did not conform to the intended behavior of isequal in MATLAB. Consider the following example:

a = Simulink.Parameter;
b = Simulink.Parameter;
isequal(a,b);
ans = false

In R2012a, the behavior of isequal has changed to conform to the intended behavior of isequal in MATLAB. Now, isequal compares two Simulink data objects by comparing their individual property values. Based on the above example, provided objects a and b have similar property values, the new result will be as follows.

a = Simulink.Parameter;
b = Simulink.Parameter;
isequal(a,b);
ans = true

isContentEqual Will Be Removed in a Future Release

Previously, you could use method isContentEqual to compare the property values of two Simulink data objects.

In this release, the behavior of isequal has been changed so that it can replace isContentEqual.

In a future release, support for isContentEqual will be removed. Use isequal instead.

Compatibility Considerations

If you are using the isContentEqual method in your MATLAB code to compare Simulink data objects, replace all instances of isContentEqual with isequal.

Change in Behavior of int32 Property Type

Previously, when you created int32 properties for a level-1 data class using the Data Class Designer, the property value was stored as a double-precision value.

In R2012a, the behavior of int32 properties has changed. Now, int32 properties for a level-2 data classes are stored as a single-precision values.

RTWInfo Property Renamed

In R2012a, the property RTWInfo of a Simulink data object has been renamed as CoderInfo.

Compatibility Considerations

If your code uses the RTWInfo property to access data object parameters such as StorageClass, replace instances of RTWInfo in your code with CoderInfo. Your existing code will continue to work as before.

deepCopy Method Will Be Removed in a Future Release

Previously, you could use a Simulink data object's deepCopy method to create a copy of the data object along with its properties.

a = Simulink.Parameter;
b = a.deepCopy;

In a future release, the deepCopy method will be removed. Use the copy method instead.

a = Simulink.Parameter;
b = a.copy;

The copy does not create a reference. To create a reference, use the following commands.

a = Simulink.Parameter;
b = a;

New Methods for Querying Workspace Variables

Previously, you could query model workspace variables using the evalin method, but you had to resave your model after using this method.

In R2012a, use two new Simulink.Workspace methods to query workspace variables without having to resave your model:

  • hasVariable: Determines if a variable exists in the workspace.

  • getVariable: Gets the value of a variable from the workspace.

Default Package Specification for Data Objects

In R2012a, you can specify a default data package other than Simulink. Set the default package in the Data Management Defaults pane of the Simulink Preferences dialog box.

Simulink applies your default package setting to the Model Explorer, Data Object Wizard, and Signal Properties dialog box.

Simulink.Parameter Enhancements

The following enhancements have been made to Simulink.Parameter data objects:

  • You can now explicitly specify the data type property of a Simulink.Parameter object as double.

  • When casting values to specified data types, the values of Simulink.Parameter objects are now cast using the casting diagnostic used for block parameters.

    • Scalar value is cast to fixed-point data type.

    • Array or matrix value is cast to fixed-point data type.

    • Structure value is cast to bus data type.

    For more information on creating typesafe models, see Data Typing Rules

Custom Storage Class Specification for Discrete States on Block Dialog Box

Previously, you could specify custom storage classes (CSCs) for discrete states only by creating a signal object in the base workspace, associating it with the discrete state, and assigning the CSC to the signal object.

In R2012a, you can specify CSCs for discrete states directly on the block dialog box.

For example, you can specify a CSC for the discrete state of a Unit Delay block as follows:

  1. Open the block dialog box.

  2. Click the State Attributes tab.

  3. Select a Package.

  4. Select the desired CSC from the Storage class drop-down list.

  5. Set Custom attributes for the storage class.

Enhancement to set_param

Previously, when you used set_param to make changes to the value of a parameter, Simulink allowed the change to be committed even if the set_param operation failed. Consequently, an invalid value persisted in the parameter and an error was generated during model simulation.

In this release, the behavior of set_param has been enhanced so that Simulink does not change the value of a parameter if the set_param operation fails. Instead, the parameter retains its original value.

Compatibility Considerations

  1. Sections of your code might not work if they depend on the value of a parameter set using set_param within a try-catch block. Consider revising such sections of code to account for the new behavior.

  2. If you are setting dependent parameters using separate set_param commands for each parameter, consider revising the code so that all dependent parameters are set using a single command. Setting individual parameters might cause the set_param operation to fail for the dependent parameters.

    For example, consider three dependent parameters of the Integrator block: Lower Saturation, Upper Saturation, and Initial Condition. The dependency condition among these parameters is as follows: Lower Saturation ≤ Initial Condition ≤ Upper Saturation.

    Here, setting one parameter at a time might cause the set_param operation to fail if a dependency condition is not satisfied. It might be better to set all parameters together using a single set_param command.

    Avoid

    try
    		set_param(Handle, 'Param1', Value1)
    end
    		set_param(Handle, 'Param2', Value2)

    Better

    set_param(Handle, 'Param1', Value1, 'Param2', Value2)

Simulink.findVars Support for Active Configuration Sets

Simulink.findVars now searches for variables that are used in a model's active configuration set. For example, you can now use Simulink.findVars to search for variables that are used to specify configuration parameters such as Start time and Stop time.

Use either the Model Explorer or the Simulink.findVars command-line interface to search for variables used by an active configuration set.

Bus Support for To File and From File Blocks

The To File block supports saving virtual and nonvirtual bus data.

The From File block supports loading nonvirtual bus data.

Bus Support for To Workspace and From Workspace Blocks

The To Workspace block supports saving bus data, with a new default save format, Timeseries. For bus data, the Timeseries format uses a structure of MATLAB timeseries objects, and for non-bus data, a MATLAB timeseries object.

The From Workspace block now supports loading bus data. To do so, specify a bus object as the output data type.

Logging Fixed-Point Data to the To Workspace Block

If you configure the To Workspace block to log fixed-point data as fi objects, then the workspace variable should use the same data type as the input. To preserve the data type of scaled doubles inputs, Simulink logs them to fi objects.

Compatibility Considerations

In releases prior to R2012a, when you configured the To Workspace block to log fixed-point data as fi objects and the input data type was scaled doubles, then Simulink discarded the scaled doubles data type and logged the data as doubles.

Improved Algorithm for Best Precision Scaling

In R2012a, using best-precision scaling is less likely to result in proposed data types that could result in overflows. The new algorithm prevents overflows for all rounding modes except Ceiling.

For example, consider a Data Type Conversion block with an Output minimum of -128.6, and rounding mode Floor, and data type specified as fixdt(1,8). In previous releases, for an input signal value of -128.6, best precision scaling set the output data type to fixdt(1,8,0) which resulted in an overflow. In R2012a, for the same model, best precision scaling now prevents such overflows by setting the output data type to fixdt(1,8,-1) and the signal value becomes -128.

Compatibility Considerations

Best-precision scaling in R2012a calculates a different data type from that calculated in R2011b only if the value being scaled is between (RepMin - LSB) and RepMin, where RepMin is the representable minimum of the proposed data type. Under these conditions, the output data type used by the block might change to avoid overflow. This change might reduce precision and result in the propagation of different data types. It might also affect the data types proposed by the Fixed-Point Advisor and Fixed-Point Tool.

Enhancement of Mask Parameter Promotion

The manner in which promoted variables are named in the mask editor has changed.

Consider the following example.

You mask a subsystem that contains two parameters that are candidates for promotion: Upper Limit and Lower Limit. You promote parameter Upper Limit, but later decide to promote a different parameter. So you remove your original promotion of Upper Limit and promote parameter Lower Limit instead.

In previous releases, even though you changed the promotion to parameter Lower Limit, the auto-generated name and prompt for this parameter remained UpperLimit.

In this release, when you change the promotion to parameter Lower Limit, the variable name and the prompt of the parameter change to LowerLimit. However, if you had manually changed the variable name for your originally promoted parameter Upper Limit to ChangedLimit, the variable name for the new promotion will also be ChangedLimit.

File Management

SLX Format for Model Files

In R2012a, Simulink provides a new option to save your model file in the SLX format, with file extension .slx. The SLX file format contains the same information as an MDL file and is a compressed package that conforms to the Open Packaging Conventions (OPC) interoperability standard. SLX stores model information using Unicode UTF-8 in XML and other international formats.

Saving Simulink in the SLX format:

  • Typically reduces file size. The file size reduction between MDL and SLX varies depending on the model.

  • Solves some problems in previous releases with loading and saving MDL files containing Korean and Chinese characters.

  • Supports new features in future releases not supported with MDL format.

The default file format remains MDL, and the MDL format will remain available for the foreseeable future.

To use the SLX format, see File format for new models and libraries in the Simulink Preferences documentation.

Compatibility Considerations

SLX will become the default file format in a future release. In R2012a you can optionally save your models in the SLX format. All functionality and APIs that currently exist for working with models, such as the get_param and set_param commands, are also available when using the SLX file format.

The MDL file format will continue to be supported, but, after R2012a, new features might be available only if you use the SLX file format.

When you use the SLX file format, the new file extension .slx might cause compatibility issues if your scripts contain hard-coded references to file names with extension .mdl. To check for future problems, verify that your code works with both the MDL and SLX formats. If you find any places in your scripts that need to be updated, use functions like which and what instead of strings with .mdl.

    Caution   If you use third-party source control tools, be sure to register the model file extension .slx as a binary file format. If you do not, these third-party tools might corrupt SLX files when you submit them.

ReleaseOperations with Possible Compatibility ConsiderationsWhat Happens Action
R2012aIn 12a, SLX is optional. No compatibility considerations, unless you choose to save as SLX.Nothing, unless you choose to try SLX.
If you try SLX, see the following rows for possible impact.
None.
Future release with SLX default.Hard-coded references to file names with extension .mdl. Scripts cannot find or process models saved with new file extension .slx. Make your code work with both the .mdl and .slx extension.
Use functions like which and what instead of strings with .mdl.
Third-party source control tools that assume a text format by default. Binary format of SLX files can cause third-party tools to corrupt the files when you submit them. Register .slx as a binary file format with third-party source control tools.

For more information, see Saving Models in the SLX File Format in the Simulink documentation.

The format of content within MDL and SLX files is subject to change. Use documented APIs (such as get_param, find_system, and Simulink.MDLInfo) to operate on model data.

Simulink Project Enhancements

In R2012a, Simulink projects include the following enhancements:

  • New export to Zip file capability to package and share project files.

  • Dependency analysis graph views to visualize project file dependencies.

  • Easily compare and merge project file labels and shortcuts to resolve conflicts during peer review workflow.

  • New ability to load a project and use the project API to run setup tasks on a MATLAB worker.

  • Extended source control support with the Source Control Adapter SDK for authoring integration with third-party tools.

For more information on using projects, see Managing Projects in the Simulink documentation.

Compatibility Considerations

Functionality What Happens When You Use This Functionality? Use This Functionality Instead Compatibility Considerations
getRootDirectoryWarnsgetRootFolderReplace all instances of getRootDirectory with getRootFolder

See the Simulink.ModelManagement.Project.CurrentProject reference page.

Signal Management

Signal Hierarchy Viewer

To display the signal hierarchy for a signal:

  1. Right-click a signal.

  2. Select the Signal Hierarchy option to open the new Signal Hierarchy Viewer.

For details, see Signal Hierarchy Viewer.

Signal Label Propagation Improvements

Prior to R2012a, signal label propagation behaved inconsistently in different modeling contexts. Signal label propagation is the process that Simulink uses when it passes signal labels to downstream connection blocks (for example, Subsystem and Signal Specification blocks).

In R2012a, signal label propagation is consistent:

  • For different modeling constructs (for example, different kinds of signals, different kinds of buses, model referencing, variants, and libraries)

  • In models with or without hidden blocks, which Simulink inserts in certain cases to enable simulation

  • At model load, edit, update, and simulation times

For details, see Signal Label Propagation.

Compatibility Considerations

In the Signal Properties dialog box, for the Show propagated signals parameter, you can no longer specify the all option. When you save a pre-R2012a model in R2012a, Simulink changes the all settings to on.

The following blocks no longer support signal label propagation. When you open legacy models that have signal label propagation enabled for these blocks, Simulink does not display a warning or error, and does not propagate the signal label.

  • Assignment

  • Bus Assignment

  • Bus Creator

  • Bus Selector

  • Demux

  • Matrix Concatenate

  • Mux

  • Selector

  • Vector Concatenate

  • Bus-capable blocks (Memory, Merge, Multiport Switch, Permute Dimensions, Probe, Rate Transition, Reshape, S-Function, Switch, Unit Delay, Width, and Zero-Order Hold)

You can name the output of a Bus Creator block and choose to have that name propagated to any downstream connection blocks.

To view the hierarchy for any bus signal, use the new Signal Hierarchy Viewer.

Frame-Based Processing: Inherited Option of the Input Processing Parameter Now Provides a Warning

Some Simulink blocks are able to process both sample- and frame-based signals. After the transition to the new way of handling frame-based processing, signals will no longer carry information about their frame status. Blocks that can perform both sample- and frame-based processing will have a new parameter that allows you to specify the appropriate processing behavior.

To prepare for this change, many blocks received a new Input processing parameter in previous releases. You can set this parameter to Columns as channels (frame based) or Elements as channels (sample based), depending upon the type of processing you want. The third choice, Inherited (this choice will be removed - see release notes), is a temporary selection that is available to help you migrate your existing models from the old paradigm of frame-based processing to the new paradigm.

In this release, your model provides a warning when the following conditions are all met for any block in your model:

  • The Input processing parameter is set to Inherited (this choice will be removed - see release notes).

  • The input signal is sample-based.

  • The input signal is a vector, matrix, or N-dimensional array.

Compatibility Considerations

To eliminate this warning, you must upgrade your existing models using the slupdate function. The function detects all blocks that have Inherited (this choice will be removed - see release notes) selected for the Input processing parameter. It then asks you whether you would like to upgrade each block. If you select yes, the function detects the status of the frame bit on the input port of the block. If the frame bit is 1 (frames), the function sets the Input processing parameter to Columns as channels (frame based). If the bit is 0 (samples), the function sets the parameter to Elements as channels (sample based).

In a future release, the frame bit and the Inherited (this choice will be removed - see release notes) option will be removed. At that time, the Input processing parameter in models that have not been upgraded will automatically be set to either Columns as channels (frame based) or Elements as channels (sample based). The option set will depend on the library default setting for each block. If the library default setting does not match the parameter setting in your model, your model will produce unexpected results. Additionally, after the frame bit is removed, you will no longer be able to upgrade your models using the slupdate function. Therefore, you should upgrade your existing modes using slupdate as soon as possible.

Logging Frame-Based Signals

In this release, a new warning message appears when a Simulink model is logging frame-based signals and the Signal logging format is set to ModelDataLogs. In ModelDataLogs mode, signals are logged differently depending on the status of the frame bit, as shown in the following table.

Status of Frame BitTodayWhen Frame Bit Is Removed
Sample-based3-D array with samples in time in the third dimension3-D array with samples in time in the third dimension
Frame-based2-D array with frames in time concatenated in the first dimension3-D array with samples in time in the third dimension

This warning advises you to switch your Signal logging format to Dataset. The Dataset logging mode logs all 2-D signals as 3-D arrays, so its behavior is not dependent on the status of the frame bit.

When you get the warning message, to continue logging signals as a 2-D array:

  1. Select Simulation > Configuration Parameters > Data Import/Export, and change Signal logging format to Dataset. To do so for multiple models, click the link provided in the warning message.

  2. Simulate the model.

  3. Use the dsp.util.getLogsArray function to extract the logged signal as a 2-D array.

Frame-Based Processing: Model Reference and Using slupdate

In this release, the Model block has been updated so that its operation does not depend on the frame status of its input signals.

Compatibility Considerations

In a future release, signals will not have a frameness attribute, therefore models that use the Model block must be updated to retain their behavior. If you are using a model with a Model block in it, follow these steps to update your model:

  1. For both the child and the parent models:

    • In the Configuration Parameters dialog box, select the Diagnostics > Compatibility pane.

    • Change the Block behavior depends on input frame status parameter to warning.

  2. For both the child and the parent models, run slupdate.

  3. For the child model only:

    • In the Configuration Parameters dialog box, select the Diagnostics > Compatibility pane.

    • Change the Block behavior depends on input frame status parameter to error.

Removing Mixed Frameness Support for Bus Signals on Unit Delay and Delay

This release phases out support for buses with mixed sample and frame-based elements on the Unit Delay and Delay blocks in Simulink. When the frame bit is removed in a future release, any Delay block that has a bus input of mixed frameness will start producing different results. This incompatibility is phased over multiple releases. In R2012a the blocks will start warning. In a future release, when the frame bit is removed, the blocks will error.

Block Enhancements

Delay Block Accepts Buses and Variable-Size Signals at the Data Input Port

In R2012a, the Delay block provides the following support for bus signals:

  • The data input port u accepts virtual and nonvirtual bus signals. The other input ports do not accept bus signals.

  • The output port has the same bus type as the data input port u for bus inputs.

  • Buses work with:

    • Sample-based and frame-based processing

    • Fixed and variable delay length

    • Array and circular buffers

To use a bus signal as the input to a Delay block, you must specify the initial condition in the dialog box. In other words, the initial condition cannot come from the input port x0.

In R2012a, the Delay block also provides the following support for variable-size signals:

  • The data input port u accepts variable-size signals. The other input ports do not accept variable-size signals.

  • The output port has the same signal dimensions as the data input port u for variable-size inputs.

The rules for variable-size signal support depend on the input processing mode of the Delay block. See the block reference page for details.

n-D Lookup Table Block Has New Default Settings

In R2012a, the default values of the Table data and Breakpoints 3 parameters of the n-D Lookup Table block have changed:

  • Table datareshape(repmat([4 5 6;16 19 20;10 18 23],1,2),[3,3,2])

  • Breakpoints 3[5, 7]

The default values of all other block parameters remain the same.

Blocks with Discrete States Can Specify Custom Storage Classes in the Dialog Box

In R2012a, the following blocks have additional parameters on the State Attributes tab to support specification of custom storage classes:

  • Data Store Memory

  • Delay

  • Discrete Filter

  • Discrete State-Space

  • Discrete Transfer Fcn

  • Discrete Zero-Pole

  • Discrete-Time Integrator

  • Memory

  • PID Controller

  • PID Controller (2 DOF)

  • Unit Delay

In previous releases, specifying a custom storage class for a block required creating a signal object in the base workspace. In R2012a, you can specify the custom storage class on the State Attributes tab of the block dialog box.

Inherited Option of the Input Processing Parameter Now Provides a Warning

Some Simulink blocks are able to process both sample- and frame-based signals. After the transition to the new way of handling frame-based processing, signals will no longer carry information about their frame status. Blocks that can perform both sample- and frame-based processing will have a new parameter that allows you to specify the appropriate processing behavior. To prepare for this change, many blocks received a new Input processing parameter in previous releases. See Version 7.8 (R2011b) Simulink Software for details. You can set this parameter to Columns as channels (frame based) or Elements as channels (sample based), depending on the type of processing you want. The third choice, Inherited, is a temporary selection that is available to help you migrate your existing models from the old paradigm of frame-based processing to the new paradigm.

In this release, your model will provide a warning for the following blocks when the Input processing parameter is set to Inherited, the input signal is frame-based, and the input signal is a vector, matrix, or N-dimensional array:

  • Unit Delay

  • Delay

  • Bias

  • Tapped Delay

Compatibility Considerations

To eliminate this warning, you must upgrade your existing models using the slupdate function. The function detects all blocks that have Inherited selected for the Input processing parameter, and asks you whether you would like to upgrade each block. If you select yes, the function detects the status of the frame bit on the input port of the block. If the frame bit is 1 (frames), the function sets the Input processing parameter to Columns as channels (frame based). If the bit is 0 (samples), the function sets the parameter to Elements as channels (sample based).

In a future release, the frame bit and the Inherited option will be removed. At that time, the Input processing parameter in models that have not been upgraded will automatically be set to either Columns as channels (frame based) or Elements as channels (sample based), depending on the library default setting for each block. If the library default setting does not match the parameter setting in your model, your model will produce unexpected results. Also, after the frame bit is removed, you will no longer be able to upgrade your models using the slupdate function. Therefore, upgrade your existing models using slupdate as soon as possible.

User Interface Enhancements

Model Advisor: Highlighting

When a Model Advisor analysis is complete, you can specify that the Model Advisor highlight blocks in a model diagram relevant to warning and failure conditions reported for individual Model Advisor checks. When you click a check, in the model window you can easily see which objects pass, receive a warning, or fail the check.

Model Explorer: Grouping Enhancements

In the object property table, you can now group data objects by the object type property. (As in earlier releases, you can also group data objects by other property columns.)

  1. Right-click the empty heading in the first column (the column that displays icons such as the block icon ( )).

  2. In the context menu, select Group By This Column.

The object property table also displays the number of objects in each group.

For details about grouping, see Grouping by a Property.

Model Explorer: Row Filter Button

You can access the row filter options by using the new Row Filter button, which is to the right of the object count at the top of the Contents pane.

As an alternative, you also can access the row filter options by selecting View > Row Filter.

For details, see Using the Row Filter Option.

Simulation Data Inspector Enhancements

Signal Data Organization

In R2012a, the Group Signals option allows you to customize the organization of the signal data in the Signal Browser table. By default, the data is first grouped by Run Name. You can then group the signal data by model hierarchy or by the logged variable name. Choose options that help you more easily find signals for viewing or comparing. For more information, see Modify Grouping in Signal Browser Table.

Block Name Column

The Signal Browser Table now includes a Block Name column. For the signal data, the Block Name column displays the name of the block that feeds the signal. To add this column to the table, right-click the Signal Browser table, and from the Columns list, select Block Name. For more information, see Add/Delete a Column in the Signal Browser Table.

Plot Check Box Moved

In the Signal Browser table, the plot check box is no longer in a separate Plot column. To select a signal for plotting, go to the left-most column where the plot check box is now located.

Parallel Simulation Support

The Simulation Data Inspector API now works with parallel simulations using the parfor command. To use the Simulation Data Inspector to record and view the results from parallel simulations, you can use the following methods to get and set the location of the Simulation Data Inspector repository:

For more information, see Record Data During Parallel Simulations

Port Value Displays

The behavior of port value displays for blocks has changed. In addition to performance improvements, the changes include:

  • Port values are now port-based instead of block-based.

  • Block Output Display Options dialog box has been changed to Value Label Display Options.

  • Show none display option name has been changed to Remove All.

  • You can now right-click a signal line and select Show Port Value. In previous releases, you enable port value displays only through the Block Output Display Options dialog box.

  • The port value display is an empty box you toggle or hover on a block and have not yet run the simulation. In previous releases, it displayed xx.xx.

  • The port value displays the string wait when you toggle or hover on a block that Simulink has optimized out of the simulation.

For more information, see Displaying Port Values in the Simulink User's Guide.

Modeling Guidelines

MathWorks Automotive Advisory Board Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow

The MathWorks Automotive Advisory Board (MAAB) working group created Version 2.2 of the MAAB Guidelines Using MATLAB, Simulink, and Stateflow. For more information, see MathWorks Automotive Advisory Board Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow.

Execution on Target Hardware

New Feature for Running Models Directly from Simulink on Target Hardware

Use the new Run on Target Hardware feature to automatically run a Simulink model on target hardware.

The feature supports the following target hardware:

  • BeagleBoard™

  • LEGO MINDSTORMS NXT™

As part of the Run on Target Hardware feature, use the Target Installer to download and install support for your target hardware. To start the Target Installer, enter targetinstaller in a MATLAB Command Window, or open a Simulink model and select Tools > Run on Target Hardware > Install/Update Support Package....

When the Target Installer utility has finished, demos and a block library for your target hardware are available.

To view the demos, enter doc in the MATLAB Command Window. In the product help window that opens, look for Other Demos near the bottom, under the Contents tab.

To view the block library, enter simulink in the MATLAB Command Window. This action will launch the Simulink Library Browser. When the Simulink Library Browser opens, look for one of the following block libraries:

  • Target for Use with BeagleBoard Hardware

  • Target for Use with LEGO MINDSTORMS NXT Hardware

For more information, you can read the documentation for Running Models on Target Hardware.

R2011b

New Features, Bug Fixes, Compatibility Considerations

Simulation Performance

Accelerator Mode Now Supports Algebraic Loops

The Accelerator mode now works with models that contain algebraic loops. In previous releases, using Accelerator mode for models that contained algebraic loops returned error messages.

Component-Based Modeling

For Each Subsystem Support for Continuous Dynamics

For Each Subsystem blocks support continuous dynamics. This feature simplifies modeling a system of identical plant models.

The continuous dynamics support includes:

  • Non-trigger sample time, including multi-rate and multitasking

  • Continuous states

  • Algebraic loops

  • Blocks in the SimDriveline™, SimElectronics®, and SimHydraulics® products

To see an example using continuous dynamics with a For Each Subsystem block, run the sldemo_metro_foreachsldemo_metro_foreach demo.

Enable Port as an Input to a Root-Level Model

You can add an Enable port to the root level of a model. The referenced model can also use a Trigger port.

Using a root-level Enable port takes advantage of model referencing benefits, without your having to do either of these extra steps:

  • Put all blocks in an enabled subsystem into a referenced model

  • Put the entire enabled subsystem in a referenced model

Compatibility Considerations

When you add an enable port to the root-level of a model, if you use the File > Save As option to specify a release before R2011b, then Simulink replaces the enable port with an empty subsystem.

Finder Option for Looking Inside Referenced Models

The Finder tool has a new Look inside referenced models option that allows you to search within a model reference hierarchy.

Improved Detection for Rebuilding Model Reference Targets

To determine when to rebuild model reference simulation and Simulink Coder targets, Simulink uses structural checksums of file contents. The use of checksums provides more accurate detection of file changes that require a rebuild. Checksum checking is particularly valuable in environments that store models in content management systems.

For details, see Rebuild.

Model Reference Target Generation Closes Unneeded Libraries

When building model reference simulation and Simulink Coder targets, Simulink opens any unloaded libraries necessary for the build. Before R2011b, Simulink did not close the libraries that it opened during the build process.

In R2011b, Simulink closes all libraries no longer needed for target generation or simulation. Simulink leaves the following kinds of libraries open:

  • Libraries used by referenced models running in Normal mode

  • Libraries that were already open at the start of the target generation process

Concurrent Execution Support

This release extends the modeling capabilities within the Simulink product to capture and simulate the effects of deploying your design to multicore systems. In addition, you can deploy your designs to an actual multicore system using Simulink Coder, Embedded Coder, and Simulink Real-Time™ software. You can:

  • Create a new model configuration or extend existing configurations for concurrent execution.

  • Use Model blocks to define potential opportunities for concurrency in your design.

  • Easily set up and configure concurrent on-target tasks using a task editing interface.

  • Use either the GUI or command-line APIs to iteratively map design partitions (based on Model blocks) to tasks to find optimal concurrent execution scenarios.

  • Generate code that leverages threading APIs for Windows, Linux, VxWorks®, and Simulink Real-Time platforms for concurrent on-target execution.

Finer Control of Library Links

Libraries and links have been enhanced with the following features:

  • New option to lock links to libraries. Lockable library links enable control of end user editing, to prevent unintentional disabling of these links. This feature ensures robust usage of mature stable libraries.

  • New check for read-only library files when you try to save, and option to try to make library writable.

  • New options in Links Tool to push or restore individual edited links, in addition to existing option to push or restore entire hierarchies of links.

  • get_param and set_param enhanced to perform loading of library links, making programmatic manipulation of models easier and more robust. For example, Simulink now loads links consistently if you use either load_system or open_system before using get_param.

For details, see Working with Library Links in the Simulink documentation.

Mask Built-In Blocks with the Mask Editor

You can now mask built-in blocks with the Mask Editor to provide custom icons and dialogs. In previous releases, you could mask only Subsystem, Model, and S-Function blocks. Now, in the Mask Editor, you can choose to promote any underlying parameter of any block to the mask. For subsystems, you can choose to promote parameters from any child blocks. You can associate a single mask parameter with multiple promoted parameters if they are of the same type. Changing the value of the mask parameter also sets the value of the associated promoted parameters.

You cannot mask blocks that already have masks. For example, some Simulink blocks, such as Ramp and Chirp Signal in the Sources library, cannot be masked.

For details, see Masking Blocks and Promoting Parameters in the Simulink documentation.

Parameter Checking in Masked Blocks

Masked blocks now prevent you entering invalid parameter values by reporting an error when you edit the mask dialog values. Now the parameter checking behavior of built-in and masked blocks is unified. Both block types check for valid parameter values when you change block dialog values. Parameter checking at edit time prevents you saving a model with syntax errors or invalid values.

Previously only built-in blocks reported an error at the time you enter an invalid parameter with a syntax error, but masked blocks accepted invalid values. In previous releases you could enter invalid values in masked block dialogs and not see an error until you compiled the model. If the model was not compiled you could save a model with syntax errors or other invalid values. In R2011b, parameter checking prevents this problem.

Parameter checking applies both in the mask dialog and at the command line for invalid parameters due to syntax errors (e.g. a blank parameter or invalid parameter names). Parameter checking only applies in the mask dialog for errors defined by the block. Blocks can define valid parameters, for example, the upper limit must be higher than the lower limit, or the frequency of a signal cannot be negative etc. This type of parameter checking does not apply to changes you make at the command line. This allows you to set up blocks with multiple calls to set_param, without requiring that each step checks for errors.

Menu Options to Control Variants

You can now select or open Model Variants and Variant Subsystems with the Edit and context menus. You can use the menus to open any variant choice or override the block using any variant choice. These options were previously accessible only by opening the block dialog boxes.

For details, see Modeling Variant Systems in the Simulink documentation.

MATLAB Function Blocks

Simulation Supported When the Current Folder Is a UNC Path

In R2011b, you can simulate models with MATLAB Function blocks when the current folder is a UNC path. In previous releases, simulation of those models required that the current folder not be a UNC path.

Simulink Data Management

Default Design Minimum and Maximum are []/[], Not -inf/inf

In R2011b, the default design minimum and maximum values for Simulink.Signal, Simulink.Parameter, Simulink.BusElement, and all blocks are []/[] instead of the previous default -inf/inf. You can no longer specify design minimum and maximum values of -inf/inf for blocks and these data objects.

Compatibility Considerations

Simulink generates a warning or error depending on the scenario that led to -inf/inf being specified as design minimum and maximum values. The following scenarios are possible.

  • When a Simulink data object is loaded from an old MAT-file or MATLAB file in which the design maximum and minimum values of the data object were specified as -inf/inf, Simulink generates a warning that -inf/inf is not supported and changes the design values to the new default, namely, []/[].

  • If you set the design minimum and maximum values for the above mentioned data objects as -inf/inf, Simulink generates a warning that -inf/inf is not supported and changes the design values to the new default, namely, []/[].

  • If the design minimum and maximum values evaluate to -inf/inf during compilation or at run-time, Simulink generates an error that -inf/inf is not supported.

  • If your model contains an embedded signal object with design minimum and maximum values specified as -inf/inf, Simulink generates a warning that -inf/inf is not supported.

Bus Elements Now Have Design Minimum and Maximum Properties

In previous releases, you could specify design minimum and maximum for any data, including data with a bus data type. This was done by specifying the minimum and maximum parameters on the associated blocks or data objects.

In R2011b, you can specify design minimum and maximum for each element of a bus object. You can use this capability to check the values of the corresponding data elements during update diagram and simulation. With this change, Simulink no longer checks minimum or maximum specified on block dialogs or data objects for the whole bus.

Compatibility Considerations

If you specify the minimum or maximum for bus data on block dialogs or data objects, even if these values are scalar, Simulink generates a warning and does not use the minimum or maximum for checking the values of the corresponding data elements.

Compiled Design Minimum and Maximum Values Exposed on Block Inport and Outport

In R2011b, you can view the compiled design minimum and maximum values at a block outport from the Model Editor. See Design Ranges. In addition, you can access the compiled design minimum and maximum values for a block's inport and outport from the command line. See Common Block Parameters.

Command-Line Interface for Accessing Compiled Design Minimum and Maximum

Use parameters CompiledPortDesignMax and CompiledPortDesignMin to access the design minimum of port signals at compile time. You must place the model in the compile state before querying this parameter. For example, to obtain the compiled design minimum at the outport of a block, use the following set of commands:

feval(gcs, [],[],[],'compile');
ports = get_param(gcb,'PortHandles');
outportMax = get_param(ports.Outport, 'CompiledPortDesignMax')
feval(model, [],[],[],'term');

CompiledPortDesignMax and CompiledPortDesignMin return different values depending on the type of signal.

  • [] if none of the signals has compiled minimum or maximum

  • scalar if all signals have the same specified compiled minimum or maximum

  • cell array for Mux signals

  • when the model is set to strict bus mode: structure for bus signals

  • when the model is not set to strict bus mode: [] for virtual bus signals

Back-Propagated Minimum and Maximum of Portion of Wide Signal Are Now Ignored

In previous releases, Simulink back-propagated the design minimum and maximum of a portion of a wide signal to the source port of that portion. The back-propagated design minimum and maximum were used in range checking.

In R2011b, Simulink generates a warning and ignores the back-propagated design minimum and maximum of a portion of a wide signal during range checking.

If you want to use the back-propagated design minimum and maximum for range checking of a portion of a wide signal, insert a Signal Conversion block with its Output parameter set to Signal copy in front of that portion.

Easier Importing of Signal Logging Data

You can load logged signal data into a model more easily in R2011b.

You can load elements of a Simulink.SimulationData.Signal object. When you set the Configuration Parameters > Data Import/Export > Signal logging format parameter to Dataset, the signal logging output includes Simulink.SimulationData.Signal objects. You can then use the Simulink.SimulationData.Dataset.getElement method to specify signal elements for the Configuration Parameters > Data Import/Export > Input parameter.

For an example of loading logged signal data into a model, open the sldemo_mdlref_bussldemo_mdlref_bus demo. For more information, see Importing Signal Logging Data.

Partial Specification of External Input Data

You can load external data for a subset of root-level Inport ports, without having to create data structures for the ports for which you want to use ground values.

Using the Configuration Parameters > Data Import/Export > Input parameter, in the comma-separated list, enter an empty matrix to specify ground values for a port.

Using an empty matrix for ports for which you want to use ground values simplifies the specification of external data to input. Also, you can use an empty matrix for an array of buses signal, which you cannot load into a root-level Inport block.

Command-Line Interface for Signal Logging

You can now use the MATLAB command line to perform the same signal logging tasks that you can perform with the Signal Logging Selector tool.

To configure signal logging from the command line, use methods for the following classes:

Simulink.SimulationData ClassSignal Logging Configuration Component
ModelLoggingInfo

Signals to log for a given simulation. Use to override the logging settings stored within a given model or referenced model.

SignalLoggingInfo

Logging settings for a single signal within a model.

LoggingInfo

Collection of signal logging properties. Use to change logging settings, such as decimation, for a signal.

Access to the Data Import/Export Pane from the Signal Logging Selector

The Signal Logging Selector toolbar includes a button ( ) to open the Configuration Parameters > Data Import/Export pane. Use the Data Import/Export pane to configure the export of output signal and state data to the MATLAB® workspace during simulation.

Inexact Property Names for User-Defined Data Objects Will Not Be Supported in a Future Release

In previous releases, you could access a property of a user-defined data object using an inexact property name. For example, after creating a Simulink.Parameter data object

a = Simulink.Parameter;

you could set the property Value of the data object by using the following command.

a.v = 5;

In R2011b, Simulink generates a warning if you access a property of a user-defined data object using an inexact property name. While Simulink accesses the property using the inexact match, support for this type of matching will be removed in a future release.

Based on the example above, set the Value of the data object using the following command instead.

a.Value = 5;

Alias Types No Longer Supported with the slDataTypeAndScale Function

Simulink no longer supports calls to slDataTypeAndScale when:

  • The first argument is a Simulink.AliasType object

  • The first argument is a Simulink.NumericType object with property IsAlias set to true

Compatibility Considerations

If your model calls the internal function slDataTypeAndScale, you might encounter a compilation error for this model even though it previously compiled successfully. In this case, follow the advice of the error message to update your model to remove the call to slDataTypeAndScale.

Simulink.StructType Objects Will Not Be Supported in a Future Release

In a future release, support for Simulink.StructType objects will be removed. Use structured parameters or arrays of buses instead.

Old Block-specific Data Type Parameters No Longer Supported

In R2011b, Simulink generates a warning if you try to access any of these old block-specific data type parameters: DataType, DataTypeMode, DataTypeScalingMode, and Scaling. In a future release, support for these data type parameters will be removed. Use DataTypeStr instead.

Simulink.Signal and Simulink.Parameter Will Not Accept Input Arguments

Simulink generates an error if you pass an input argument to the classes Simulink.Signal and Simulink.Parameter.

Compatibility Considerations

Simulink.Signal and Simulink.Parameter classes accepted input arguments in previous versions. However, the arguments were ignored for both classes.

Data Import/Export Pane Changes

The following parameters of the Configuration Parameters > Import/Export pane have changed to improve their usability.

Pre-R2011b Parameter NameChanged R2011b Parameter Name
Signal Logging SelectorConfigure Signals to Log
Return as single objectSave simulation output as single object
Inspect signal logs when simulation is paused/stoppedRecord and inspect simulation output

Simulation Data Inspector Tool Replaces Time Series Tool

The Simulation Data Inspector is now the default browser for logged simulation results. Use the Simulation Data Inspector for viewing all Simulink logged data results, including as a replacement for the Time Series tool.

Compatibility Considerations

In R2011b, the Time Series tool (tstool) no longer supports Simulink data results.

Simulink File Management

Project Management

Organize large modelling projects with new Simulink Projects. Find all your required files, manage and share files, settings, and user-defined tasks, and interact with source control.

Projects can promote more efficient team work and local productivity by helping you:

  • Find all the files that belong with your project

  • Share projects using integration with external source control tool Subversion

  • View and label modified files for peer review workflows

  • Create standard ways to initialize and shutdown a project

  • Create, store and easily access common operations

You can use projects to manage:

  • Your design (.mdl, .m, .mat, and other files, source code for S-functions, data)

  • The results or artifacts (simulation results, generated code, logfiles from code generation, reports).

  • A set of user-defined actions to use with your project (e.g., run setup code; open models, simulate; build; run shutdown code).

  • Change sets of modified files for review and interaction with source control (such as check out, compare revisions, tag or label, and check in)

For more information and a demo project to try, see Managing Projects.

Simulink Signal Management

Signal Conversion Block Enhancements

The Output parameter of the Signal Conversion block now has a Signal copy option that replaces the pre-R2011b Contiguous copy and Bus copy options. The Signal copy option handles both non-bus and bus input signals, so that you do not need to update the setting if the input signal changes from a non-bus to a bus signal, or from a bus to a non-bus signal.

Also, setting the Output parameter to Nonvirtual bus enables the Data type parameter. You can use the Data type parameter to specify a Simulink.Bus object as the output data type for the Signal Conversion block. Using a bus object:

  • Eliminates the need to use a Simulink.Bus object as the data type of an upstream Bus Creator block.

  • Enables you to pass a virtual bus signal from a Bus Selector block and then create a nonvirtual bus signal.

Compatibility Considerations

The Virtual bus and Nonvirtual bus options for the Output parameter continue to work as they did in previous releases.

For models created in a release before R2011b, two compatibility issues can occur. Both of the compatibility issues occur when the Signal Conversion block a virtual bus as its input and has its Output parameter set to Contiguous copy.

The first compatibility issue occurs if the output of the Signal Conversion block has a Simulink.Signal object associated with it.

  • Prior to R2011b, Simulink automatically performed a bus-to-vector conversion and did not report an error.

  • If you open the pre-R2011b model in R2011b, then Simulink converts the Contiguous copy option setting to Signal copy and does not convert the bus signal to a vector. Because you cannot associate a Simulink.Signal object with a virtual bus signal, Simulink reports an error.

The second compatibility issue occurs if a virtual bus signal from a Signal Conversion block that has its Output parameter set to Contiguous copy is input to a Bus Creator block that has a Simulink.Bus object as its output data type.

  • Prior to R2011b, Simulink considered the virtual bus signal to be a vector (as in the first compatibility issue), and did not report an error.

  • If you open the model in R2011b, Simulink considers the virtual bus signal to be a bus signal. That bus signal and the bus object associated with Bus Creator block are inconsistent, so Simulink reports an error.

To avoid each of these compatibility issues, insert a Bus to Vector block at the input of the Signal Conversion block.

Environment Controller Block Support for Non-Bus Signals

You can use a non-bus signal as an input to the Environment Controller block, even if you set the Configuration Parameters > Diagnostics > Connectivity > Non-bus signals treated as bus signals diagnostic to error.

Sample Time Propagation Changes

The way that Simulink software propagates sample time has been improved for models with the Optimization > Signals and Parameters > Inline parameters check box cleared (off). This change:

  • Reduces the difference in sample time propagation results between when Inline parameters is off and on.

  • Improves the performance of your model.

Compatibility Considerations

This change is beneficial to the performance of your model. Not all models are affected by the sample time propagation change. To determine if your model is affected, see Sample Time Propagation and Inline Parameters Incompatibility. That page provides guidelines, including information about a script, to help you evaluate your models.

To do this without the script,

  • If Inline parameters is on for your model, your model is not affected by this change.

  • If Inline parameters is off in your model, in R2011a or earlier, use the following procedure for each block in your model:

    1. With Inline parameters off for your model, select Edit > Update Diagram.

    2. Use get_param to collect the CompiledSampleTime value of the block.

    3. Turn Inline parameters on for your model.

    4. Update the diagram again.

    5. Use get_param to collect the CompiledSampleTime value of the block.

    6. Compare the results from steps 2 and 5. If they are different, and the result from step 5 is not inf, your model might be affected. To determine for certain if your model is affected, perform steps 1 and 2 in R2011b and compare the results with those of steps 1 and 2 from R2011a or earlier.

If you prefer the sample time propagation results from R2011a and earlier with Inline parameters off, you can ensure the desired sample times by manually specifying them on the affected block. If the block does not have a sample time parameter, use the Signal Specification block to specify sample times on the input or output signal.

Frame-Based Processing

In signal processing applications, you often need to process sequential samples of data at once as a group, rather than one sample at a time. Simulink documentation refers to the former as frame-based processing, and to the latter as sample-based processing. A frame is a collection of samples of data, sequential in time.

Historically, Simulink-family products that can perform frame-based processing propagate frame-based signals throughout a model. The frame status is an attribute of the signals in a model, just as data type and dimensions are attributes of a signal. The Simulink engine propagates the frame attribute of a signal by means of a frame bit, which can either be on or off. When the frame bit is on, Simulink interprets the signal as frame based and displays it as a double line, rather than the single line sample-based signal.

Beginning in R2010b, MathWorks started to significantly change the handling of frame-based processing. In the future, frame status will no longer be a signal attribute. Instead, individual blocks will control whether they treat inputs as frames of data or as samples of data. To learn how a particular block handles its input, you can refer to the block reference page.

To make the transition to the new paradigm of frame-based processing, the following Simulink blocks have a new Input processing parameter:

You can specify three options with the Input processing parameter:

  • Elements as channels (sample-based)

  • Columns as channels (frame-based)

  • Inherited

For more information about R2011b changes relating to frame-based processing, in the DSP System Toolbox release notes, see Frame-Based Processing.

Compatibility Considerations

When you choose the Inherited option for the Input processing parameter and the input signal is frame-based, Simulink® will generate a warning or error in future releases.

Block Enhancements

New Delay Block That Upgrades the Integer Delay Block

In R2011b, the new Delay block in the Discrete library supports:

  • Variable delay length

  • Specification of initial condition from input port

  • Reset of the state to the initial condition using an external reset signal

  • State storage

  • Use of a circular buffer instead of an array buffer for state storage

When you open models created in previous releases, the new Delay block replaces each instance of the Integer Delay block, which no longer appears in the Discrete library. The Delay block is an upgrade of the Integer Delay block. Every parameter from the Integer Delay block maps directly to a parameter in the Delay block.

Compatibility Considerations

The following incompatibilities might affect simulation of pre-R2011b models that use the Integer Delay block:

Source of IncompatibilityBehavior in the Integer Delay BlockBehavior in the Delay BlockRationaleHow to Avoid an Error

Initial condition for input signals of N-by-1 or 1-by-N dimensions and sample-based processing

Suppose that delay length is D. For Initial condition, the Integer Delay block supports signal dimensions of D-by-N and N-by-D.

For Initial condition, the Delay block supports signal dimensions of N-by-1-by-D or 1-by-N-by-D. Using any other format causes an error during simulation.

The Delay block prevents misinterpretation of the dimensions for Initial condition by accepting only one format for signal dimensions.

Verify that Initial condition uses N-by-1-by-D or 1-by-N-by-D for the format of signal dimensions.

Initial condition for input signals of M-by-N dimensions and sample-based processing

Suppose that the delay length is D. For Initial condition, the Integer Delay block supports signal dimensions of D-by-M-by-N, M-by-N-by-D, and M-by-D-by-N.

For Initial condition, the Delay block supports signal dimensions of M-by-N-by-D. Using any other format causes an error during simulation.

The Delay block prevents misinterpretation of the dimensions for Initial condition by accepting only one format for signal dimensions.

Verify that Initial condition uses M-by-N-by-D for the format of signal dimensions.

Sample time

For Sample time, the Integer Delay block supports 0. In this case, the block output has continuous sample time, but fixed in minor time step.

Setting Sample time to 0 for the Delay block causes an error during simulation.

Because the Delay block belongs to the Discrete library, it should not support continuous sample time.

Use a discrete sample time, or set Sample time to –1 to inherit the sample time.

Rate transition usage

The Integer Delay block handles rate transitions for sample- and frame-based signals.

The Delay block handles rate transitions only for sample-based signals. For frame-based signals, simulation stops due to an error.

This usage of the Delay block is not recommended.

Do not use the Delay block for rate transitions with frame-based signals.

Sqrt and Reciprocal Sqrt Blocks Support Explicit Specification of Intermediate Data Type

In R2011b, both the Sqrt and Reciprocal Sqrt blocks enable specifying the data type for intermediate results. In previous releases, specifying this data type was available for the Reciprocal Sqrt block, but not the Sqrt block.

The Reciprocal Sqrt block now provides additional options for specifying the data type for intermediate results:

This enhancement enables explicit specification of the data type. In previous releases, specification of this data type was limited to inheritance rules.

For a summary of data type configurations that are valid (input, output, and intermediate results), refer to the block reference page.

Discrete Zero-Pole Block Supports Single-Precision Inputs and Outputs

The Discrete Zero-Pole block now accepts and outputs signals of single data type.

n-D Lookup Table Block Supports Tunable Table Size

The n-D Lookup Table block provides new parameters for specifying a tunable table size in the generated code.

This enhancement enables you to change the size and values of your lookup table and breakpoint data without regenerating or recompiling the code.

Boolean Output Data Type Support for Logic Blocks

The following blocks now enable specification of Output data type, which can be uint8 or boolean:

This enhancement enables you to specify the output data type to be boolean. In previous releases, the blocks always used uint8 for the output data type.

Derivative Block Parameter Change

The block Linearization Time Constant s/(Ns + 1) parameter has changed to Coefficient c in the transfer function approximation s/(c.s + 1) used for linearization. Correspondingly, the command-line parameter has changed from LinearizePole to CoefficientInTFapproximation.

User Interface Enhancements

Model Explorer: First Two Columns in Contents Pane Remain Visible

In the object property table, the behavior of the first two columns (the object icon and the Name property) has changed. These columns now remain visible, regardless of how far you scroll to the right. For an example that illustrates this feature, see Horizontal Scrolling in the Object Property Table.

Model Explorer: Subsystem Code View Added

Model Explorer provides an additional Column View option: Subsystem Code. The Subsystem Code view displays Subsystem block code generation properties. For details about views, see The Model Explorer: Controlling Contents Using Views.

Model Explorer: New Context Menu Options for Model Configurations

R2011b provides new context menu options for a model in the Model Hierarchy pane. A new menu option, Configuration, organizes previous and new model configuration operations. To view these configuration options, in the Model Hierarchy pane, right-click a model node and select Configuration. The following table describes the available configuration options.

To...Select...
Load an existing configuration set to the modelImport
Save the model's active configuration set to a:
  • .m file (as MATLAB function or script) or

  • .mat file (Simulink.ConfigSet object)

Export Active Configuration Set
Attach a new configuration set to the modelAdd Configuration
Create a configuration reference and attach it to the modelAdd Configuration Reference
Create a concurrent execution configuration set Add Configuration for Concurrent Execution
Convert the model's active configuration set to a configuration reference, which then becomes active for the modelConvert Active Configuration to Reference

Two new context menu options are available for a configuration set node under a model node in the Model Hierarchy pane.

To...Use...
Convert an active configuration set to a configuration referenceConvert to Configuration Reference (only enabled for active configuration sets)
Convert a configuration set to a concurrent execution configuration setConvert to Configuration for Concurrent Execution

In R2011b, if a model has an active configuration reference, you can create a copy of the configuration reference for each referenced model. To perform this operation, in the Model Hierarchy pane, right-click the active configuration reference node and select Propagate to Referenced Models.

For more information on model configurations, see Managing Model Configurations.

Simulation Data Inspector Enhancements

Command-Line Interface

The Simulation Data Inspector command-line interface is now available to view and compare signal data, and compare two simulation runs of data. For more information, see Record and Inspect Signal Data Programmatically.

Report Generation

Using the Simulation Data Inspector tool or the command-line interface, you can now generate a report of a Simulation Data Inspector session. To generate a report using the GUI, see Create Simulation Data Inspector Report. To generate a report using the command-line interface, see the Simulink.sdi.report function.

Support of Scope, To File, and To Workspace Blocks

The Simulation Data Inspector now supports output from the following blocks:

Conversion of Error and Warning Message Identifiers

For R2011b, error and warning message identifiers have changed in Simulink.

Compatibility Considerations

If you have scripts or functions that use message identifiers that changed, you must update the code to use the new identifiers. Typically, message identifiers are used to turn off specific warning messages, or in code that uses a try/catch statement and performs an action based on a specific error identifier.

For example, the MATLAB:eigs:NonPosIntSize identifier has changed to MATLAB:eigs:RoundNonIntSize. If your code checks for MATLAB:eigs:NonPosIntSize, you must update it to check for MATLAB:eigs:RoundNonIntSize instead.

To determine the identifier for a warning, run the following command just after you see the warning in the MATLAB Command Window.

[MSG,MSGID] = lastwarn;

This command saves the message identifier to the variable MSGID.

To determine the identifier for an error, run the following command just after you see the error in the MATLAB Command Window.

exception = MException.last;
MSGID = exception.identifier;

    Note:   Warning messages indicate a potential issue with your code. While you can turn off a warning, a suggested alternative is to change your code so it runs warning-free.

New Modeling Guidelines

Modeling Guidelines for High-Integrity Systems

Modeling Guidelines for Code Generation

R2011a

New Features, Bug Fixes, Compatibility Considerations

Simulation Performance

Restore SimState in Models Created in Earlier Simulink Versions

Simulink 7.7 supports the restoring of a SimState from a MAT file saved in a previous version of Simulink. During this operation, Simulink restores as much of the SimState object as possible and automatically resets the simulation start time to the stop time of the SimState object.

You can choose to receive a warning or an error by setting a new diagnostic, SimState object from earlier release, on the Diagnostic Pane of the Configuration Parameters dialog.

Improved Absolute Tolerance Implementation

The processing of the absolute tolerance parameter in the Solver configuration pane, and of the absolute tolerance parameters for continuous blocks and S-functions with continuous states, has been enhanced. As a result, these parameters provide a more robust and consistent behavior. These error tolerances are used by variable-step solvers to control integration error for continuous states in a model.

A new SimStruct function ssSetStateAbsTol has been introduced to allow for setting the absolute tolerances for the S-Function continuous states in models using a variable-step solver. Use of ssGetAbsTol to either get or set absolute tolerances is not recommended. Instead, use ssGetStateAbsTol and ssSetStateAbsTol to get and set tolerances, respectively.

Component-Based Modeling

Refreshing Linked Blocks and Model Blocks

You can refresh linked blocks and Model blocks in a library or model using the Simulink Editor. Select the Edit > Links and Model Blocks > Refresh.

Refreshing the linked blocks updates the linked blocks to reflect any changes to the original library block. In releases before R2011a, to update linked blocks, you had to take one of the following actions:

  • Close and reopen the library that contains the linked blocks that you want to refresh.

  • Update the diagram (Edit > Links and Update Diagram or Ctrl+D).

You can update a specific Model block by right-clicking the Model block and selecting Refresh.

Compatibility Considerations

The new menu option, Edit > Links and Model Blocks > Refresh menu item replaces Edit > Model Blocks > Refresh Model Blocks. Both the old and new options update Model blocks in the same way.

Enhanced Model Block Displays Variant Model Choices

The Model Variants block now displays model names for all variant choices, making it easier to select and configure available variants.

Creating a Protected Model Using the Simulink Editor

You can protect a model using the Simulink Editor. Right-click the Model block that references the model for which you want to generate protected model code. In the context menu, select Code Generation > Generate Protected Model. For details, see Creating a Protected Model.

In earlier releases, you had to use the Simulink.ModelReference.protect command to create a protected model.

MATLAB Function Blocks

Embedded MATLAB Function Block Renamed as MATLAB Function Block

In R2011a, Embedded MATLAB Function blocks were renamed as MATLAB Function blocks in Simulink models. The block also has a new look:

Compatibility Considerations

If you have scripts that refer to Embedded MATLAB library blocks by path, you need to update the script to reflect the new block name. For example, if your script refers to simulink/User-Defined Functions/Embedded MATLAB Function or eml_lib/Embedded MATLAB Function, change Embedded MATLAB Function to MATLAB Function.

Support for Buses in Data Store Memory

MATLAB Function blocks now support buses as shared data in Data Store Memory blocks.

Simulink Data Management

Signal Logging Selector

The Signal Logging Selector is a new centralized signal logging tool for:

  • Reviewing all signals in a model hierarchy that are configured for logging (set with the Signal Properties dialog box)

  • Overriding signal logging settings for specific signals

  • Controlling signal logging throughout a model reference hierarchy in a more streamlined way than in previous releases

You can use the Signal Logging Selector with Simulink and Stateflow signals.

To open the Signal Logging Selector, in the Configuration Parameters > Data Import/Export pane, select the Signal Logging Selector button. For a Model block, you can right-click the block and select the Log Referenced Signals menu item. (The Signal Logging Selector replaces the Model Reference Signal Logging dialog box.)

Dataset Format Option for Signal Logging Data

You can now select a format for signal logging data. Use the Configuration Parameters > Data Import/Export > Signal logging format parameter to select the format:

The Dataset format:

  • Uses MATLAB timeseries objects to store logged data (rather than Simulink.Timeseries and Simulink.TsArray objects). MATLAB timeseries objects allow you to work with logging data in MATLAB without a Simulink license.

  • Supports logging multiple data values for a given time step, which can be important for Iterator subsystem and Stateflow signal logging.

  • Provides an easy-to-analyze format for logged signal data for models with deep hierarchies, bus signals, and signals with duplicate or invalid names.

  • Supports the Simulation Data Inspector.

  • Avoids the limitations of the ModelDataLogs format. For example, for a virtual bus, ModelDataLogs format logs only one of multiple signals that share the same source block. For a description of ModelDataLogs format limitations, see Bug Report 495436.

To convert a model that contains referenced models to use the Dataset format throughout the model reference hierarchy, use the Simulink.SimulationData.updateDatasetFormatLogging function.

If you have logged signal data in the ModelDataLogs format, you can use the Simulink.ModelDataLogs.convertToDataset function to convert the ModelDataLogs data to Dataset format.

To work with Dataset format data, you can use properties and methods of the following classes:

For information about the signal logging format, see Specifying the Signal Logging Data Format

From File Block Supports Zero-Crossing Detection

The From File block allows you to specify zero-crossing detection.

Signal Builder Block Now Supports Virtual Bus Output

You can now define the type of output to use on the Signal Builder block now outputs signals. With this release, the Signal Builder block has two options:

  • Ports

    Sends individual signals from the block. An output port named Signal N appears for each signal N. This option is the default setting. In previous releases, the block uses this type of signal output.

  • Bus

    Sends single, virtual, nonhierarchical bus of signals from the block. An output port named Bus appears. This Bus option enables you to change your model layout without having to reroute Signal Builder block signals. You cannot use this option to create a bus of nonvirtual signals.

For more information, see Defining Signal Output in the Simulink User's Guide

Signal Builder Block Now Shows the Currently Active Group

The Signal Builder block now shows the currently active group on its block mask.

signalbuilder Function Change

The signalbuilder function has a new command, 'annotategroup'. This command enables the display of the current group name on the Signal Builder block mask.

Range-Checking Logic for Fixed-Point Data During Simulation Improved

The logic that Simulink uses to check whether design minimum and maximum values are within the specified data type range is now consistent with the logic that it uses to calculate best-precision scaling.

  • Simulink now checks both real-world values and quantized values for a block parameter, Simulink.Parameter object, or Simulink.Signal object against design minimum and maximum values. Prior to R2011a, Simulink checked only real-world values against design minimum and maximum values.

  • When Simulink checks the design minimum and maximum values for a Simulink.Signal object against the data type minimum and maximum values, it obtains the data type range in one of the following ways.

    1. If the data type for a Simulink.Signal object is set, Simulink uses the range defined in the specification of that data type

    2. If the data type for a Simulink.Signal object is set to auto, Simulink uses the range for the data type inferred from the initial value of the signal's fi object

    Prior to R2011a, Simulink only used the data type range defined in the specification of that data type.

  • Simulink now checks the run-time parameter value of an S-function against the design minimum and maximum values when the parameter is updated at run-time and during compilation. Prior to R2011a, Simulink checked run-time parameter values of an S-function against the design minimum and maximum only at run-time.

For more information about block parameter range checking, see Checking Parameter Values.

Compatibility Considerations

  • An error is generated if the quantized value of a block parameter, Simulink.Parameter object, or Simulink.Signal object in your model is different from the real-world value and if this difference causes the quantized value to lie outside the design minimum and maximum range.

  • An error is generated if the initial value of a Simulink.Signal object in your model is a fi object and if this initial value is outside the range associated with that fi object.

  • An error is generated at compile time if the run-time parameter value of an S-function in your model is outside the design minimum and maximum range.

Data Object Wizard Now Supports Boolean, Enumerated, and Structured Data Types for Parameters

In this release, the Data Object Wizard is enhanced to suggest parameter objects for variables with the following data types:

  • Boolean

  • Enumerations

  • Structures

Error Now Generated When Initialized Signal Objects Back Propagate to Output Port of Ground Block

Prior to this release, Simulink generated an error when the output of a Ground block was a signal object with an initial value, but did not do the same for such signal objects back propagated to the output port of a Ground block. As of R2011a, Simulink generates an error under both conditions.

No Longer Able to Set RTWInfo or CustomAttributes Property of Simulink Data Objects

You can no longer set the RTWInfo or CustomAttributes property of a Simulink data object from the MATLAB Command Window or a MATLAB script. Attempts to set these properties generate an error.

Although you cannot set RTWInfo or CustomAttributes, you can still set subproperties of RTWInfo and CustomAttributes.

Compatibility Considerations

Operations from the MATLAB Command Window or a MATLAB script, which set the data object property RTWInfo or CustomAttributes, generate an error.

For example, a MATLAB script might set these properties by copying a data object as shown below:

a = Simulink.Parameter;
b = Simulink.Parameter;
b.RTWInfo = a.RTWInfo;
b.RTWInfo.CustomAttributes = a.RTWInfo.CustomAttributes;
 .
 .
 .

To copy a data object, use the object's deepCopy method.

a = Simulink.Parameter;
b = a.deepCopy;
.
.
.

Global Data Stores Now Treat Vector Signals as One or Two Dimensional

Simulink now uses the Dimensions attribute of a source signal object to determine whether to register a global data store as a vector (1-D) or matrix (2-D). For example, if the Dimensions attribute of a source signal object is set to [1 N] or [N 1], Simulink registers the global data store as a matrix. Prior to R2011a, Simulink treated all global data stores as vectors.

The following table lists possible signal object dimension settings with what Simulink registers for a corresponding global data store:

Source Signal Object DimensionsRegistered for Global Data Store
–1Get dimensions from InitialValue and interpret vectors as 1-D
NVector with N elements
[1 N]1xN matrix
[N 1]Nx1 matrix

Compatibility Considerations

If you specify the dimensions of the source signal object for a global data store as [1 N] or [N 1], Simulink now registers the data store as a matrix. Although this change has no impact on numeric results of simulation or execution of generated code, the change can affect the following:

  • Propagation of dimensions (for example, signals might propagate as [1 N] or [N 1] instead of N).

  • Signal and state logging

    • Vectors are logged as 2D matrices – [nTimeSteps width]

    • 2-D matrices are logged as 3-D matrices – [M N nTimeSteps]

No Longer Able to Use Trigger Signals Defined as Enumerations

You can no longer use trigger signals that are defined as enumerations. A trigger signal represents an external input that initiates execution of a triggered subsystem. Prior to R2011a, Simulink supported enumerated trigger signals for simulation, but produced an error during code generation. This change clarifies triggered subsystem modeling semantics by making them consistent across simulation and code generation.

Compatibility Considerations

Use of enumerated trigger signals during simulation now generates an error. To work around this change, compare enumeration values, as appropriate, and apply the resulting Boolean or integer signal value as the subsystem trigger.

Conversions of Simulink.Parameter Object Structure Field Data to Corresponding Bus Element Type Supported for double Only

If you specify the DataType field of a Simulink.Parameter object as a bus, you must specify Value as a numeric structure. Prior to R2011a, Simulink would convert the data types of all fields of that structure to the data types of corresponding bus elements. As of R2011a, Simulink converts the data type of structure fields of type double only. If the data type of a field of the structure does not match the data type of the corresponding bus element and is not double, an error occurs.

This change does not affect the InitialValue field of Simulink.Signal objects. Data types of fields of a numeric structure for an initial condition must match data types of corresponding bus elements.

Compatibility Considerations

If the data type of a field of a numeric structure that you specify for Simulink.Parameter does not match the data type of the corresponding bus element and is not double, an error occurs. To correct the condition, set the data types of all fields of the structure to match the data types of all bus elements or set them to type double.

For more information, see Simulink.Parameter.

Simulink.CustomParameter and Simulink.CustomSignal Data Classes To Be Deprecated in a Future Release

In a future release, data classes Simulink.CustomParameter and Simulink.CustomSignal will no longer be supported because they are equivalent to Simulink.Parameter and Simulink.Signal.

Compatibility Considerations

If you use the data class Simulink.CustomParameter or Simulink.CustomSignal, Simulink posts a warning that identifies the class and describes one or more techniques for eliminating it. You can ignore these warnings in R2011a, but consider making the described changes now because the classes will be removed in a future release.

Parts of Data Class Infrastructure No Longer Available

Simulink has been generating warnings for usage of the following data class infrastructure features for several releases. As of R2011a, the features are no longer supported.

  • Custom storage classes not captured in the custom storage class registration file (csc_registration) – warning displayed since R14SP2

  • Built-in custom data class attributes BitFieldName and FileName+IncludeDelimiterwarning displayed since R2008b

    Instead of...Use...
    BitFieldNameStructName
    FileName+IncludeDelimiterHeaderFile

  • Initial value of MPT data objects inside mpt.CustomRTWInfoSignalwarning displayed since R2006a

Compatibility Considerations

  • When you use a removed feature, Simulink now generates an error.

  • When loading a MAT-file that uses an unsupported feature, the load operation suppresses the generated error such that it is not visible. In addition, MATLAB silently deletes data that had been associated with the unsupported feature. To prevent loss of data when loading a MAT-file, load and resave the file with R2010b or earlier.

Simulink Signal Management

Data Store Support for Bus Signals

The following blocks support the use of bus and array of buses signals with data stores:

Benefits of using buses and arrays of buses with data stores include:

  • Simplifying the model layout by associating multiple signals with a single data store

  • Producing generated code that represents the data store data as structures that reflect the bus hierarchy

  • Writing to and reading from data stores without creating data copies, resulting in more efficient data access

Compatibility Considerations

Pre-R2011a models that use data stores work in R2011a without any modifications.

To save a model that uses buses with data stores to a pre-R2011a version, you need to restructure that model to not rely on using buses with data stores.

Accessing Bus and Matrix Elements in Data Stores

You can select specific bus or matrix elements to read from or write to a data store. To do so, use the Element Selection pane of the Data Store Read block and the Element Assignment pane of the Data Store Write block. Selecting bus or matrix elements offers the following benefits:

  • Reducing the number of blocks in the model. For example, you can eliminate a Data Store Read and Bus Selector block pair or a Data Store Write and Bus Assignment block pair for each specific bus element that you want to access.

  • Faster simulation of models with large buses and arrays of buses.

Array of Buses Support for Permute Dimensions, Probe, and Reshape Blocks

The following blocks now support the use of an array of buses as an input signal:

For details about arrays of buses, see Combining Buses into an Array of Buses.

Using the Bus Editor to Create Simulink.Parameter Objects and MATLAB Structures

You can use the Bus Editor to:

  • Define or edit a Simulink.Parameter object with a bus object for its data type. In the Bus Editor, select the parameter and use one of these approaches:

    • Select the File > Create/Edit a Simulink.Parameter object menu item.

    • Click the Create/Edit a Simulink.Parameter object icon ( ) from the toolbar.

    You can then edit the Simulink.Parameter object in the MATLAB Editor.

  • Invoke the Simulink.Bus.createMATLABStruct function for a bus object for which you want to create a full MATLAB structure. In the Bus Editor, select the bus object and use one of these approaches:

    • Select the File > Create a MATLAB structure menu item.

    • Click the Create a MATLAB structure icon ( ) from the toolbar.

    You can then edit the MATLAB structure in the MATLAB Editor.

Block Enhancements

Lookup Table, Lookup Table (2-D), and Lookup Table (n-D) Blocks Replaced with Newer Versions in the Simulink Library

In R2011a, the following lookup table blocks have been replaced with newer versions, which differ from the previous versions as follows:

BlockEnhancements to the Previous VersionOther Changes

Lookup Table

  • Default integer rounding mode changed from Floor to Simplest

  • Support for the following features:

    • Specification of parameter data types different from input or output signal types

    • Reduced memory use and faster code execution for nontunable breakpoints with even spacing

    • Cubic-spline interpolation and extrapolation

    • Table data with complex values

    • Fixed-point data types with word lengths up to 128 bits

    • Specification of data types for fraction and intermediate results

    • Specification of index search method

    • Specification of diagnostic for out-of-range inputs

Lookup Table (2-D)

  • Default integer rounding mode changed from Floor to Simplest

  • Support for the following features:

    • Specification of parameter data types different from input or output signal types

    • Reduced memory use and faster code execution for nontunable breakpoints with even spacing

    • Cubic-spline interpolation and extrapolation

    • Table data with complex values

    • Fixed-point data types with word lengths up to 128 bits

    • Specification of data types for fraction and intermediate results

    • Specification of index search method

    • Specification of diagnostic for out-of-range inputs

  • Check box for Require all inputs to have the same data type now selected by default

Lookup Table (n-D)

  • Default integer rounding mode changed from Floor to Simplest

When you load models from earlier versions of Simulink that contain the Lookup Table, Lookup Table (2-D), and Lookup Table (n-D) blocks, those versions of the blocks appear. In R2011a, the new versions of the lookup table blocks appear only when you drag the blocks from the Simulink Library Browser into new models.

When you use the add_block function to programmatically add the Lookup Table, Lookup Table (2-D), or Lookup Table (n-D) blocks to a model, those versions of the blocks appear. If you want to add the new versions of the blocks to your model, change the source block path for add_block as follows:

BlockOld Block PathNew Block Path
Lookup Table simulink/Lookup Tables/Lookup Tablesimulink/Lookup Tables/1-D Lookup Table
Lookup Table (2-D)simulink/Lookup Tables/Lookup Table (2-D)simulink/Lookup Tables/2-D Lookup Table
Lookup Table (n-D)simulink/Lookup Tables/Lookup Table (n-D)simulink/Lookup Tables/n-D Lookup Table

To upgrade your model to use new versions of the Lookup Table and Lookup Table (2-D) blocks, follow these steps:

StepDescriptionReason
1

Run the Simulink Model Advisor check for Check model, local libraries, and referenced models for known upgrade issues requiring compile time information.

Identify blocks that do not have compatible settings with the new 1-D Lookup Table and 2-D Lookup Table blocks.

2

For each block that does not have compatible settings:

  • Decide how to address each warning.

  • Adjust block parameters as needed.

Modify each Lookup Table or Lookup Table (2-D) block to make them compatible with the new versions.

3

Repeat steps 1 and 2 until you are satisfied with the results of the Model Advisor check.

Ensure that block replacement works for the entire model.

4

Run the slupdate function on your model.

Perform block replacement with the 1-D Lookup Table and 2-D Lookup Table blocks.

Note that after block replacement, the block names that appear in the model remain the same. However, the block icons match the new ones for the 1-D Lookup Table and 2-D Lookup Table blocks.

Compatibility Considerations

The Model Advisor check groups all Lookup Table and Lookup Table (2-D) blocks into three categories:

  • Blocks that have compatible settings with the new 1-D Lookup Table and 2-D Lookup Table blocks

  • Blocks that have incompatible settings with the new 1-D Lookup Table and 2-D Lookup Table blocks

  • Blocks that have repeated breakpoints

Blocks with Compatible Settings

When a block has compatible parameter settings with the new block, automatic block replacement can occur without backward incompatibilities.

Lookup Method in the Lookup Table or Lookup Table (2-D) BlockParameter Settings in the New Block After Automatic Block Replacement
InterpolationExtrapolation
Interpolation-ExtrapolationLinearLinear
Interpolation-Use End ValuesLinearClip
Use Input BelowFlatNot applicable

Depending on breakpoint characteristics, the new block uses one of two index search methods.

Breakpoint Characteristics in the Lookup Table or Lookup Table (2-D) BlockIndex Search Method in the New Block After Automatic Block Replacement
Not evenly spacedBinary search
Evenly spaced and tunableA prompt appears, asking you to select Binary search or Evenly spaced points.
Evenly spaced and not tunable

The new block also adopts other parameter settings from the Lookup Table or Lookup Table (2-D) block. For parameters that exist only in the new block, the following default settings apply after block replacement:

Parameter in the New BlockDefault Setting After Block Replacement
Breakpoint data typeInherit: Same as corresponding input
Diagnostic for out-of-range inputNone

Blocks with Incompatible Settings

When a block has incompatible parameter settings with the new block, the Model Advisor shows a warning and a recommended action, if applicable.

  • If you perform the recommended action, you can avoid incompatibility during block replacement.

  • If you use automatic block replacement without performing the recommended action, you might see numerical differences in your results.

Incompatibility WarningRecommended ActionWhat Happens for Automatic Block Replacement

The Lookup Method is Use Input Nearest or Use Input Above. The new block does not support these lookup methods.

Change the lookup method to one of the following:

  • Interpolation - Extrapolation

  • Interpolation - Use End Values

  • Use Input Below

The Lookup Method changes to Interpolation - Use End Values.

In the new block, this setting corresponds to:

  • Interpolation set to Linear

  • Extrapolation set to Clip

You also see a message that explains possible numerical differences.

The Lookup Method is Interpolation - Extrapolation, but the input and output are not the same floating-point type. The new block supports linear extrapolation only when all inputs and outputs are the same floating-point type.

Change the extrapolation method or the port data types of the block.

The block uses small fixed-point word lengths, so that interpolation uses only one rounding operation. The new block uses two rounding operations for interpolation.

None

You see a message that explains possible numerical differences.

Blocks with Repeated Breakpoints

When a block has repeated breakpoints, the Model Advisor recommends that you change the breakpoint data and rerun the check. You cannot perform automatic block replacement for blocks with repeated breakpoints.

Magnitude-Angle to Complex Block Supports CORDIC Algorithm and Fixed-Point Data Types

The Magnitude-Angle to Complex block now supports the following parameters:

The benefits of the new block parameters are as follows:

New Block ParameterPurposeBenefit
Approximation method

Specify the type of approximation the block uses to compute output: None or CORDIC.

Enables you to use a faster method of computing block output for fixed-point and HDL applications.

Number of iterations

For the CORDIC algorithm, specify how many iterations to use for computing block output.

Enables you to adjust the precision of your block output.

Scale output by reciprocal of gain factor

For the CORDIC algorithm, specify whether or not to scale the real and imaginary parts of the complex output.

Provides a more accurate numerical result for the CORDIC approximation.

This block now accepts and outputs fixed-point signals when you set Approximation method to CORDIC.

Trigonometric Function Block Supports Complex Exponential Output

The Trigonometric Function block now supports complex exponential output: cos + jsin. This function works with the CORDIC algorithm.

This block also accepts inputs with unsigned fixed-point data types when you use the CORDIC approximation. In previous releases, only signed fixed-point inputs were supported.

Shift Arithmetic Block Supports Specification of Bit Shift Values as Input Signal

The Shift Arithmetic block now supports specification of bit shift values from an input port. Previously, you could specify bit shift values only on the dialog box. This enhancement enables you to change bit shift values without stopping a simulation.

The block now also supports the following functionality:

EnhancementBenefit

Specification of diagnostic for out-of-range bit shift values

Flags out-of-range bit shift values during simulation

Option to check for out-of-range bit shift values in the generated code

Enables you to control the efficiency of the generated code

The following parameter changes apply to the Shift Arithmetic block. For backward compatibility, the old command-line parameters continue to work.

Old Prompt on Block Dialog BoxNew Prompt on Block Dialog BoxOld Command-Line ParameterNew Command-Line Parameter
Number of bits to shift rightBits to shift: NumbernBitShiftRightBitShiftNumber
Number of places by which binary point shifts rightBinary points to shift: NumbernBinPtShiftRightBinPtShiftNumber

The read-only BlockType property has also changed from SubSystem to ArithShift.

Multiple Lookup Table Blocks Enable Removal of Range-Checking Code

When the breakpoint input to a Prelookup, 1-D Lookup Table, 2-D Lookup Table, or n-D Lookup Table block falls within the range of valid breakpoint values, you can disable range checking in the generated code. By selecting Remove protection against out-of-range input in generated code on the block dialog box, your code can be more efficient.

Similarly, when the index input to an Interpolation Using Prelookup block falls within the range of valid index values, you can disable range checking in the generated code. By selecting Remove protection against out-of-range index in generated code on the block dialog box, your code can be more efficient.

The Remove protection against out-of-range index in generated code check box replaces the Check index in generated code check box from previous releases. When you load models with the Interpolation Using Prelookup block from previous releases, the following parameter mapping applies:

Parameter Setting from Previous ReleasesParameter Setting for R2011a
Check index in generated code is selected.Remove protection against out-of-range index in generated code is not selected.
Check index in generated code is not selected.Remove protection against out-of-range index in generated code is selected.

For backward compatibility, the command-line parameter CheckIndexInCode continues to work.

Enhanced Dialog Layout for the Prelookup and Interpolation Using Prelookup Blocks

In R2011a, the dialog boxes for the Prelookup and Interpolation Using Prelookup blocks consolidate parameters related to data type attributes on a single tab named Data Types. This enhancement enables you to specify data type attributes more quickly on the block dialog box.

  • For the Prelookup block, you can now specify breakpoint, index, and fraction attributes on a single tab.

  • For the Interpolation Using Prelookup block, you can now specify table, intermediate results, and output attributes on a single tab.

Product of Elements Block Uses a Single Algorithm for Element-Wise Complex Division

In previous releases, the Product of Elements block used two different algorithms for handling element-wise complex division. For example, for a matrix input with four elements (u1, u2, u3, and u4), the following behavior would apply:

  • For inputs with built-in integer and floating-point data types, the order of operations was 1/(u1*u2*u3*u4).

  • For inputs with fixed-point data types, the order of operations was ((((1/u1)/u2)/u3)/u4).

Starting in R2011a, the Product of Elements block uses a single algorithm for handling element-wise complex division. For inputs of integer, floating-point, or fixed-point type, the order of operations is always (((((1/u1)/u2)/u3)/u4)…/uN).

Sign Block Supports Complex Floating-Point Inputs

The Sign block now supports complex inputs of type double or single. The block output matches the MATLAB result for complex floating-point inputs.

When the input u is a complex scalar, the block output is:

sign(u) = u./ abs(u)

When an element of a vector or matrix input is complex, the block uses the same formula that applies to scalar input.

MATLAB Fcn Block Renamed to Interpreted MATLAB Function Block

In R2011a, the MATLAB Fcn block has been renamed to Interpreted MATLAB Function block. The icon has also changed to match the new block name. However, all functionality and block parameters remain the same. The read-only BlockType property is also unchanged.

Existing scripts that use the add_block function to programmatically add the MATLAB Fcn block to models do not require any changes.

When you load existing models that contain the MATLAB Fcn block, the block name that appears in the model remains unchanged. However, the block icon matches the new one for the Interpreted MATLAB Function block.

Environment Controller Block Port Renamed from RTW to Coder

In R2011a, the Environment Controller block has renamed the RTW port to Coder. This enhancement better reflects the purpose of that input port, which designates signals to pass through the block when code generation occurs for a model.

Block Parameters on the State Attributes Tab Renamed

In R2011a, the block parameters Real-Time Workshop storage class and Real-Time Workshop storage type qualifier have been renamed to Code generation storage class and Code generation storage type qualifier, respectively. These two parameters appear on the State Attributes tab of the following block dialog boxes:

  • Discrete Filter

  • Discrete PID Controller

  • Discrete PID Controller (2DOF)

  • Discrete State-Space

  • Discrete Transfer Fcn

  • Discrete Zero-Pole

  • Discrete-Time Integrator

  • Memory

  • Unit Delay

Block Parameters and Values Renamed for Lookup Table Blocks

In R2011a, the Action for out-of-range input parameter has been renamed as Diagnostic for out-of-range input for the following blocks:

Also, the Process out-of-range input parameter has been renamed as Extrapolation method for the Prelookup block.

For lookup table blocks that provide Interpolation method or Extrapolation method parameters, the following changes apply:

Parameter Value from Previous ReleasesParameter Value in R2011a
None - FlatFlat
None - ClipClip

Performance Improvement for Single-Precision Computations of Elementary Math Operations

In R2011a, single-precision computations for elementary math operations are faster. This enhancement applies to the following simulation modes:

  • Normal

  • Accelerator

Dead Zone Block Expands the Region of Zero Output

In R2011a, the Dead Zone block expands the region of zero output, or the dead zone, to include inputs (U) that equal the lower limit (LL) or upper limit (UL):

InputOutput
U >= LL and U <= ULZero
U > ULUUL
U < LLULL

In previous releases, the dead zone excluded inputs that equal the lower or upper limit.

Enhanced PID Controller Blocks Display Compensator Formula in Block Dialog Box

The PID Controller and PID Controller (2 DOF) blocks now display the current compensator formula in the block dialog box. This display reflects the current settings for controller type, controller form, and time domain.

Ground Block Always Has Constant Sample Time

In R2011a, the sample time of the Ground block is now constant (inf) regardless of the setting for Inline parameters in the Configuration Parameters dialog box.

Compatibility Considerations

Previously, if Inline parameters was off, the sample time of the Ground block depended on sample-time propagation. Now, the following conditions hold true:

  • Function-call subsystem blocks that have an unconnected function-call port now have the correct sample time of constant (inf) regardless of the setting for Inline parameters.

  • Function-call subsystem blocks that have a function-call port connected to a Ground block now have the correct sample time of constant (inf) regardless of the setting for Inline parameters.

  • Function-call subsystem blocks that have the Sample time type set to periodic now correctly error out when they are connected to a Ground block or unconnected.

New Function-Call Feedback Latch Block

The Function-Call Feedback Latch block allows you to break a feedback loop involving data signals between function-call signals. You can use this block for two specific scenarios:

  • If a loop involves parent and child function-call blocks (that is, the initiator of the child function-call block is inside the parent function-call block), then place this block on the feedback signal from the child to the parent. You can thus ensure that the value of the signal does not change during execution of the child.

  • If a loop involves function-call blocks connected to branches of the same function-call signal, then this block latches the signal at the input of the destination function-call block, and thereby allows it to execute prior to the source function-call block.

In either case, the latching results in the destination block reading a delayed signal from the previous execution of the source function-call block.

Outport Driving Merge Block Does Not Require IC in Simplified Initializaton Mode

If an Outport block of a conditionally executed subsystem directly drives a Merge block, then the Outport block no longer requires the specification of an Initial Condition (IC) in simplified initialization mode. Simulink still expects the Merge block to specify an IC. This enhancement applies only when the Outport and Merge blocks are in the same model.

Discrete Filter, Discrete FIR Filter, and Discrete Transfer Fcn Blocks Now Have Input Processing Parameter

The Discrete Filter, Discrete FIR Filter, and Discrete Transfer Fcn blocks now have an Input processing parameter. This parameter enables you to specify whether the block performs sample- or frame-based processing on the input. To perform frame-based processing, you must have a DSP System Toolbox license.

Model Blocks Can Now Use the GetSet Custom Storage Class

The GetSet custom storage class can now be used for the inports and outports of Model blocks. To assign a GetSet custom storage class to the inport or outport of a referenced model block, use one of the following methods.

  1. Assign the GetSet custom storage class to the root-level inport or outport of the referenced model.

  2. Assign the GetSet custom storage class to scalar signals entering an inport of the referenced model block in the parent model, provided one of the following conditions is met.

    1. The referenced model uses function prototype control to specify that the inport should be passed by value instead of being passed by pointer to the Model block's step function.

    2. The inport to which the GetSet custom storage class is assigned should be passed by value.

  3. Assign the GetSet custom storage class to a scalar signal leaving one of the outports of the referenced model block in the parent model. In this case, the referenced model must use function prototype control to specify that the outport should be the returned value of the function.

User Interface Enhancements

Model Explorer: Hiding the Group Column

By default, the property column that you use for grouping (the group column) appears in the property table. That property also appears in the top row for each group.

To hide the group column, use one of the following approaches:

  • From the View menu, clear the Show Group Column check box.

  • Within the property table, right-click a column heading and clear the Show Group Column check box.

Simulation Data Inspector Enhancements

Multiple Plots in a View

The Simulation Data Inspector tool now supports the configuration of multiple plots into one view. On the Inspect Signals pane, on the View toolbar, select Show Details to display the View Details table.

You can create multiple views by clicking the New view from current button. In each view, you can:

  • Modify the number of plots by clicking the Layout column to display the plot matrix.

  • Name, save, and reload the view using the corresponding buttons.

  • Replace signal data for a run with the corresponding signal data of another run by clicking the Replace runs button.

For more information, see Visual Inspection of Signal Data in the Simulation Data Inspector Tool.

Display Run Properties

In R2011a, you can view the properties of a run. In the Signal Browser table, right-click a run name to view a list of options. To open the Run Properties dialog box, from the options list, select Properties.

New Toolbar Icons

The Simulation Data Inspector toolbar includes a new icon for zooming out a section of a plot. The previous zoom out icon now performs a fit to view operation, which enlarges a plot to fill the graph. To perform either operation, select the icon, and click on a plot.

Model Advisor

In R2011a, the Model Advisor tool now includes easier control of the By Product and By Task folders. In the Model Advisor, select View > Show By Product Folder or Show By Task Folder to show or hide each folder. These settings are persistent across MATLAB sessions.

In the By Task folder, there are two new subfolders:

  • Modeling and Simulation

  • Code Generation Efficiency

For more information on the Model Advisor GUI, see Consulting the Model Advisor.

Configuration Parameters Dialog Box Changes

The Configuration Parameters dialog box layout is improved to better support your workflows. The Optimization pane is reorganized into three panes:

  • General

  • Signals and Parameters

  • Stateflow

These panes make it easier to find parameters.

In R2011a, all tree nodes are collapsed by default. For details, see Configuration Parameters Dialog Box.

S-Functions

S-Functions Generated with legacy_code function and singleCPPMexFile S-Function Option Must Be Regenerated

Due to an infrastructure change, if you have generated an S-function with a call to legacy_code that defines the S-function option singleCPPMexFile, you must regenerate the S-function to use it with this release of Simulink.

Compatibility Considerations

If you have generated an S-function with a call to legacy_code that defines the S-function option singleCPPMexFile, regenerate the S-function to use it with this release of Simulink.


View release notes for older releases

Compatibility Summary

ReleaseFeatures or Changes with Compatibility Considerations
R2014a
R2013b
R2013a
R2012b
R2012a
R2011b
R2011a
Was this topic helpful?