Simulink® provides a set of predefined blocks that you can combine to create a detailed block diagram of your system. Tools for hierarchical modeling, data management, and subsystem customization enable you to represent even the most complex system concisely and accurately.
The Simulink Library Browser includes:
You can build customized functions by using these blocks or by incorporating hand-written MATLAB®, C, Fortran, or Ada code into your model.
Your custom blocks can be stored in their own libraries within the Simulink Library Browser.
Simulink add-on products let you incorporate specialized components for aerospace, communications, PID control, control logic, signal processing, video and image processing, and other applications. Add-on products are also available for modeling physical systems with mechanical, electrical, and hydraulic components.
You build a model by dragging blocks from the Simulink Library Browser into the Simulink Editor. You then connect these blocks with signal lines to establish mathematical relationships between system components. Graphical formatting tools, such as smart guides and smart signal routing, help you control the appearance of your model as you build it. You can add hierarchy by encapsulating a group of blocks and signals as a subsystem in a single block.
The Simulink Editor gives you complete control over what you see and use within the model. For example, you can add commands and submenus to the editor and context menus. You can also add a custom interface to a subsystem or model by using a mask that hides the subsystem's contents and provides the subsystem with its own icon and parameter dialog box.
The Explorer bar and Model Browser in Simulink help you navigate your model. The Explorer bar indicates the level of hierarchy that you are currently viewing and lets you move up and down the hierarchy. The Model Browser provides a complete hierarchical tree view of your model, and like the Explorer bar, can be used to move through the levels of hierarchy.
Simulink models contain both signals and parameters. Signals are time-varying data represented by the lines connecting blocks. Parameters are coefficients that define system dynamics and behavior.
Simulink helps you determine the following signal and parameter attributes:
If you choose not to specify data attributes, Simulink determines them automatically via propagation algorithms, and conducts consistency checking to ensure data integrity.
These signal and parameter attributes can be specified either within the model or in a separate data dictionary. You can then use the Model Explorer to organize, view, modify, and add data without navigating through the entire model.
Block dialog box showing the Signal Attributes tab.
You can simulate the dynamic behavior of your system and view the results as the simulation runs. To ensure simulation speed and accuracy, Simulink provides fixed-step and variable-step ODE solvers, a graphical debugger, and a model profiler.
Solvers are numerical integration algorithms that compute the system dynamics over time using information contained in the model. Simulink provides solvers to support the simulation of a broad range of systems, including continuous-time (analog), discrete-time (digital), hybrid (mixed-signal), and multirate systems of any size.
These solvers can simulate stiff systems and systems with discontinuities. You can specify simulation options, including the type and properties of the solver, simulation start and stop times, and whether to load or save simulation data. You can also set optimization and diagnostic information. Different combinations of options can be saved with the model.
Configuration Parameters dialog box showing the Solver pane.
You can run your simulation interactively from the Simulink Editor or systematically from the MATLAB command line. The following simulation modes are available:
To reduce the time required to run multiple simulations, you can run those simulations in parallel on a multi-core computer or computer cluster.
After running a simulation, you can analyze the simulation results in MATLAB and Simulink. Simulink includes debugging tools to help you understand the simulation behavior.
You can visualize the simulation behavior by viewing signals with the displays and scopes provided in Simulink. You can also view simulation data within the Simulation Data Inspector, where you can compare multiple signals from different simulation runs.
Alternatively, you can build custom HMI displays using MATLAB, or log signals to the MATLAB workspace to view and analyze the data using MATLAB algorithms and visualization tools.
Simulink supports debugging with the Simulation Stepper, which lets you step back and forth through your simulation viewing data on scopes or inspecting how and when the system changes states.
With the Simulink debugger you can step through a simulation one method at a time and examine the results of executing that method. As the model simulates, you can display information on block states, block inputs and outputs, and block method execution within the Simulink Editor.
Simulink provides tools to help you manage project-related files, components, and large amounts of data.
Simulink Projects is an interactive tool for managing project files and connecting to source control software. The Simulink Projects tool promotes collaboration across teams by enabling you to:
Simulink Projects provides connectivity to tools for source control, version control, software configuration management (SCM), product lifecycle management (PLM), and application lifecycle management (ALM). You can create a custom adapter for other third-party source control tools using the Simulink Projects Source Control SDK.
Simulink facilitates component-based modeling and modular design. You can segment your model into design components and then model, simulate, and verify each component independently. You can save components as subsystems in a library, or use model referencing to save components as separate models. Team members can then work on those components in parallel.
You can manage design variants in the same model using Model Variants and Variant Subsystems. This capability simplifies the creation and management of designs that share components, as one model can represent a family of designs.
Bus signals are provided in Simulink for managing a large set of signal data in your model. With bus signals you can consolidate multiple signals into one object, making it easier to connect those signals to another block. You can also define an array of buses to manage a group of bus objects within one package.
The Model Explorer is a graphical data dictionary tool that helps you organize, view, modify, and add data to your Simulink models. With the Model Explorer you can:
You can connect your Simulink model to hardware for rapid prototyping, hardware-in the-loop (HIL) simulation, and deployment on an embedded system.
Simulink provides built-in support for prototyping, testing, and running models on low-cost target hardware, such as Arduino®, LEGO® MINDSTORMS® NXT, and Raspberry Pi. You can design algorithms in Simulink for control systems, robotics, audio processing, and computer vision applications and see them perform in real time.
With Simulink Desktop Real-Time™, you can run Simulink models in real time on Microsoft® Windows® PCs and connect to a range of I/O boards to create and control a real-time system. To run your model in real time on a target computer, you can use Simulink Real-Time™ for HIL simulation, rapid control prototyping, and other real-time testing applications.
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi