0% found this document useful (0 votes)
121 views52 pages

Simulink - Examples

Funciones naturales

Uploaded by

bul tusan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views52 pages

Simulink - Examples

Funciones naturales

Uploaded by

bul tusan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

22/4/2020 Simulink — Examples

Simulink — Examples
Applications

General Applications

   
Simulation of a Bouncing Single Hydraulic Cylinder Thermal Model of a House Approximating Nonlinear
Ball Simulation Relationships: Type S
Thermocouple
Use two different approaches to Use Simulink® to model a hydraulic Use Simulink® to create the thermal Approximate nonlinear relationships
modeling a bouncing ball using cylinder. You can apply these model of a house. This system of a type S thermocouple.
Simulink®. concepts to applications where you models the outdoor environment, the
need to model hydraulic behavior. thermal characteristics of the house,

   
Digital Waveform Accurate Zero-Crossing Spiral Galaxy Formation Modulo-4 Counter Using
Generation: Approximating  Detection
This website uses cookies to improve your user Simulation Using
experience, MATLABcontentFlip-Flops
personalize and
a Sine Wave Function Blocks
ads, and analyze website traffic. By continuing to use this website, you consent to our

Some of the main steps needed to How zeroPlease
use of cookies. crossings work
see ourin Privacy Policy
This
to model
learnwas
moreinspired
about by cookies
the Use Flip-Flop
and how to blocks (found in the
design and evaluate a sine wave Simulink®. In this model, three classic paper "Galactic Bridges and Simulink® Extras Library) to
change your settings.
data table for use in digital waveform shifted sine waves are fed into an Tails" (Toomre & Toomre 1972). The implement a Modulo-4 counter. The
https://es.mathworks.com/help/simulink/examples.html 1/52
22/4/2020 Simulink — Examples

synthesis applications in embedded absolute value block and saturation original paper explained how disc model takes the output of a Modulo-

   
Counters Using Friction Model with Hard State Events Bang-Bang Control Using
Conditionally Executed Stops Temporal Logic
Subsystems
The contrast between enabled Model friction one way in Simulink®. Handle state events. Run the Use Stateflow® to model a bang-
subsystems and triggered The two integrators in the model simulation and see the phase plane bang temperature control system for
subsystems for the same control calculate the velocity and position of plot, where the state x1 is along the a boiler. The boiler dynamics are
signal, through the use of counter the system, which is then used in X-axis and the state x2 is along the modeled in Simulink®.

   
Inverted Pendulum with Double Spring Mass Tank Fill and Empty with Simulating Systems with
Animation System Animation Variable Transport Delay
Phenomena
Model an inverted pendulum. The Model a double spring-mass-damper Model the dynamics of liquid in a Two cases where you can use
animation is created using system with a periodically varying tank. The associated animation Simulink® to model variable

MATLAB® Handle Graphics®. The This forcing
website function.
uses Associated
cookies with the your
to improve user experience, personalize contenttransport
provides a graphical display of the and delay phenomena.
animation block is a masked S- example is an animation function tank as it empties and refills, based
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 2/52
22/4/2020 Simulink — Examples

   

Modeling a Foucault Foucault Pendulum Model Exploring Variable-Step Exploring the Solver
Pendulum with VRML Visualization Solvers Using a Stiff Model Jacobian Structure of a
Model
Model a Foucault pendulum. The Solve the differential equations for The behaviour of variable-step The example shows how to use
Foucault pendulum was the the Foucault Pendulum problem and solvers in a Foucault pendulum Simulink® to explore the solver
brainchild of the French physicist displays the pendulum bob model. Simulink® solvers ode45, Jacobian sparsity pattern, and the
Leon Foucault. It was intended to movement in the VRML scene. You ode15s, ode23, and ode23t are connection between the solver

   
Double Bouncing Ball: Use Four Hydraulic Cylinder Two Cylinder Model with Modeling Cyber-Physical
of Adaptive Zero-Crossing Simulation Load Constraints Systems
Location
Choose the correct zero-crossing Use Simulink® to create a model Model a rigid rod supporting a large Model transport delay in a variable
location algorithm, based on the with four hydraulic cylinders. See mass interconnecting two hydraulic speed conveyor belt
system dynamics. For Zeno dynamic two related examples that use the actuators. The model eliminates the
systems, or systems with strong same basic components: single springs as it applies the piston


This website uses cookies to improve your user experience, personalize content and
Automotive Applications ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 3/52
22/4/2020 Simulink — Examples

   

Modeling a Fault-Tolerant Using a Data Dictionary to Modeling Engine Timing Engine Timing Model with
Fuel Control System Manage the Data for a Fuel Using Triggered Closed Loop Control
Control System Subsystems
Combine Stateflow® with Simulink® Use data dictionaries to manage the Model a four-cylinder spark ignition Enhance a version of the open-loop
to efficiently model hybrid systems. data for a fuel rate control system internal combustion engine from the engine model (sldemo_engine -
This type of modeling is particularly designed using Simulink® and throttle to the crankshaft output. We described in "Modeling Engine
useful for systems that have Stateflow®. To familiarize yourself used well-defined physical principles Timing Using Triggered

   
Building a Clutch Lock-Up Modeling Clutch Lock-Up Modeling an Anti-Lock Automotive Suspension
Model Using If Blocks Braking System

Use Simulink® to model and Use If/Else subsystems to build a Model a simple model for an Anti- Model a simplified half-car model
simulate a rotating clutch system. clutch model. An 'If' subsystem Lock Braking System (ABS). It that includes an independent front
Although modeling a clutch system models the clutch dynamics in the simulates the dynamic behavior of a and rear vertical suspension. The
is difficult because of topological locked position while an 'Else' vehicle under hard braking model also includes body pitch and

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 4/52
22/4/2020 Simulink — Examples

   

Modeling an Automatic Vehicle Electrical System Simulating Automatic Vehicle Electrical and
Transmission Controller Climate Control Systems Climate Control Systems

Model an automotive drivetrain with Simulate the electrical system of a Simulate the working of an Interface the vehicle climate control
Simulink®. Stateflow® enhances the vehicle using Simulink® and automatic climate control system in system with a model of the electrical
Simulink model with its Simscape™ Power Systems™. a car using Simulink® and system to examine the loading
representation of the transmission Stateflow®. You can enter a effects of the climate control system


Power Window Control
Project

Use MathWorks® software and the


Model-Based Development process
to go from concept to
implementation for a power window

 This website uses cookies to improve your user experience, personalize content and
Aerospace Applications ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 5/52
22/4/2020 Simulink — Examples

   

Developing the Apollo Designing a High Angle of Six Degrees of Freedom (6- Aircraft Longitudinal Flight
Lunar Module Digital Attack Pitch Mode Control DoF) Motion Platform Control
Autopilot
"Working on the design of the Lunar Use the Control System Toolbox™ Model six degrees of freedom Model flight control for the
Module digital autopilot was the and Simulink® Control Design™ to motion in Simulink®. You can switch longitudinal motion of an aircraft.
highlight of my career as an interact with Simulink to design a between using Euler Angles and First order linear approximations of
engineer. When Neil Armstrong digital pitch control for the aircraft. In Quaternions to model the equations the aircraft and actuator behavior

   
Radar Tracking Using Optical Sensor Image Air Traffic Control Radar Designing a Guidance
MATLAB Function Block Generation Design System in MATLAB and
Simulink
Use an extended Kalman filter with Generate a movie with 64 frames Model a conceptual air traffic control Use the model of the missile
the MATLAB® Function block in and a frame size of 64 by 64 pixels (ATC) radar simulation based on the airframe presented in a number of
Simulink® to estimate an aircraft's (at 10 frames per second). The radar range equation. published papers (References [1],
position from radar measurements. movie contains a simulation of a [2] and [3]) on the use of advanced

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 6/52
22/4/2020 Simulink — Examples

Airframe Trim and


Linearize

Trim and linearize an airframe using


Simulink® Control Design™

Industrial Automation Applications

  
Anti-Windup Control Using Bumpless Control Transfer Two Degree-of-Freedom
a PID Controller Between Manual and PID PID Control for Setpoint
Control Tracking
Use anti-windup schemes to prevent Achieve bumpless control transfer Regulate the speed of an electric
integration wind-up in PID when switching from manual control motor using two degrees-of-freedom
controllers when the actuators are to PID control. We use the PID PID control with set-point weighting.
 This
saturated. We use the PID Controller website usesblock
Controller cookies
your to improve
in Simulink® to user experience,
We use and personalize
the PID Controller (2DOF) content
ads, and analyze website traffic. By continuing to use this website, you consent to our

Discrete-Event Simulation use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 7/52
22/4/2020 Simulink — Examples

Model an Ethernet
Communication Network
with CSMA/CD Protocol
Model an Ethernet communication
network with CSMA/CD protocol
using Simulink® messages and
SimEvents®. In the example, there

Large-Scale Modeling


Power Window Control
Project

Use MathWorks® software and the


Model-Based Development process
to go from concept to
 This
website uses cookies to improve your user experience, personalize content and
implementation for a power window
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Simulink Environment Fundamentals
change your settings.

https://es.mathworks.com/help/simulink/examples.html 8/52
22/4/2020 Simulink — Examples

Model Upgrades


Upgrade Simulink Models
Using a Project

Easily upgrade all the models in


your project using the Upgrade
Project tool in a project.

Block Libraries
Continuous


Modeling Cyber-Physical
Systems

 This
Model transport delay in a variable website uses cookies to improve your user experience, personalize content and
speed conveyor belt ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 9/52
22/4/2020 Simulink — Examples

Dashboard


Modeling a Fault-Tolerant
Fuel Control System

Combine Stateflow® with Simulink®


to efficiently model hybrid systems.
This type of modeling is particularly
useful for systems that have

Messages & Events


Establish Message Send
and Receive Interfaces
Between Software…
Model message-based

communication between softwareThis website uses cookies to improve your user experience, personalize content and
components that run in different
ads, and analyze website traffic. By continuing to use this website, you consent to our
applications. The example also 
use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 10/52
22/4/2020 Simulink — Examples

Modeling

   
Model a System Algorithm Create Model Components Manage Signal Lines Manage Model Data

Model a simple mechanical system Create subsystems in a model for Reduce visual complexity caused by Use supporting files to specify
composed of a mass, spring, and the plant, controller, operator, and signal lines. Group signal lines into values for reused variables.
damper. environment. buses and visualize simulation data
without sinks.

 
Reuse Model Components Create Interchangeable
from Files Variations of Model
Components
Save components in separate Create variants of a model
subsystem and model files. component.


This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Design Model Architecturechange your settings.

https://es.mathworks.com/help/simulink/examples.html 11/52
22/4/2020 Simulink — Examples

Component-Based Modeling

   
Model a System Algorithm Create Model Components Manage Signal Lines Manage Model Data

Model a simple mechanical system Create subsystems in a model for Reduce visual complexity caused by Use supporting files to specify
composed of a mass, spring, and the plant, controller, operator, and signal lines. Group signal lines into values for reused variables.
damper. environment. buses and visualize simulation data
without sinks.

  
Reuse Model Components Create Interchangeable Set Up a File Management
from Files Variations of Model System
Components
Save components in separate Create variants of a model Set up a project that contains all files
subsystem and model files. component. related to the model hierarchy.

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Subsystems use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 12/52
22/4/2020 Simulink — Examples

Reference a Subsystem
Component in a Model

Use subsystem reference in a


model.

Custom Libraries


Create a Self-Modifiable
Library Block

Example showing a self-modifiable


linked subsystem.

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Model References use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 13/52
22/4/2020 Simulink — Examples

   

Component-Based Visualizing Model Converting Subsystems to Introduction to Managing


Modeling with Model Reference Architectures Model Reference Data with Model Reference
Reference
Use Model Reference. It walks you View, explore and analyze model Automate conversion of a model The basic concepts related to
through simulation and code dependencies using the containing buses to use model managing data with model
generation of a model that Dependency Analyzer. It shows how reference. reference.
references another model multiple to find referenced models and

   
Using Data Stores Across Interface Specification Parameterize a Referenced Group Multiple Model
Multiple Models Using Bus Objects Model Programmatically Arguments into a Single
Structure
Use and log local data stores. It also Propagate bus signals into Programmatically configure multiple Programmatically configure multiple
shows how to define, use and log referenced models. It also shows instances of a referenced model to instances of a referenced model to
global data stores to share global how you can simulate the use different values for the same use different values for the same
data among referenced models. referenced models independently block parameter. block parameter by using structures.

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 14/52
22/4/2020 Simulink — Examples

Configure Instance-
Specific Data for Lookup
Tables Programmatically
When you use
Simulink.LookupTable objects to
store and configure lookup table
data for ASAP2 or AUTOSAR code

Variant Systems

   
Variant Source and Variant Variant Subsystems Propagating Variant Propagate Variant
Sink Blocks Conditions to Subsystems Condition to Conditional
Subsystem
Define variant choice in Variant Learn basic functionality of variant Understand variant condition Learn about variant condition
Source and Sink blocks. subsystems. propagation to virtual and non-virtual propagation with conditional
subsystems. subsystem.
 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 15/52
22/4/2020 Simulink — Examples

Control Variant Condition


Propagation

Control propagation of variant


conditions upstream and
downstream.

Data Stores

 
Share Data Store Between Using Data Stores Across
Instances of a Reusable Multiple Models
Algorithm
To reuse an algorithm, instead of Use and log local data stores. It also
copying and pasting the blocks, you shows how to define, use and log
can encapsulate them in a separate global data stores to share global

model file. Then, you can refer to This
the website uses cookies
data among referencedtomodels.
improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Composite Signals use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 16/52
22/4/2020 Simulink — Examples

   

Simulink Bus Signals Modeling Arrays of Buses Interface Specification Load Input Data for a Bus
Using Bus Objects Using In Bus Element
Blocks
Introduces you to the following Use arrays of buses to represent Propagate bus signals into Load input data for a bus using In
Simulink® bus signal capabilities: structured data compactly. referenced models. It also shows Bus Element blocks.
Bus Creator, Bus Selector, and Bus how you can simulate the
Assignment blocks referenced models independently

Design Model Behavior

  
Modeling Reusable Using the Prelookup and Multicore Deployment of a
Components Using Interpolation Blocks Plant Model
Multiply Instanced…
In this example, the model The Prelookup block allows you to Illustrates how to take advantage of
slexCounterFunctionMdlRef minimize the number of index executing multithreaded code on a
contains a Simulink Function searches performed across a set of multicore processor using graphical
 This
website
update() which maintains a counter. uses
look-up cookies
tables and alsototoimprove
mix your user experience,
partitioning. personalize
This example requires content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use ofand
Conditionally Executed Subsystems cookies.
Models Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 17/52
22/4/2020 Simulink — Examples

   

Enabled Subsystems Advanced Enabled Triggered Subsystems Discrete and Continuous


Subsystems Resettable Subsystems

What happens when a sine wave is What happens when a sine wave is Triggered subsystems and describes The comparison between behaviors
fed into an enabled subsystem. After fed into an enabled subsystem. The the different trigger types. A of discrete and continuous
running the simulation, the scope four subsystems in the model triggered subsystem is executed for resettable subsystems. After running
shows three plots. contain integrators, either discrete or a single time step whenever the the simulation, the two scopes show


Block Priority

What happens when blocks are


assigned different priorities. The
block priority affects the order in
which the blocks are executed. You

 This website uses cookies to improve your user experience, personalize content and
Logical Conditionally Executedads,
Subsystems
and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 18/52
22/4/2020 Simulink — Examples

   

Simulink Subsystem Modeling Clutch Lock-Up Parallel Channel Power If-Then-Else Blocks
Semantics Using If Blocks Allocation

This set of examples shows different Use If/Else subsystems to build a A potential use of the Find block. What happens when a sine wave is
types of Simulink® Subsystems and clutch model. An 'If' subsystem This block outputs a variable-size fed into an If block. After running the
what semantics are used when models the clutch dynamics in the signal containing the indices of the simulation, the scope shows three
simulating these Subsystems. Each locked position while an 'Else' nonzero values of the input. plots. This example is designed to

Simulink Functions

   
Monitoring Ink Status on a Modeling Reusable Modeling Services and Dynamic Priority
Shared Printer Using Components Using Access from Application Scheduling of Functions
Simulink Functions Multiply Instanced… Software
How clients, in this case three In this example, the model This examples shows a typical A common modeling pattern to
computers, can send jobs to a slexCounterFunctionMdlRef software modeling pattern involving dynamically schedule the execution
server, a printer, and receive status contains a Simulink Function services and access to those of functions using a Stateflow chart.

from that server. This example This website uses
update() cookies
which to improve
maintains a counter. your user experience,
services personalize content and
in an application.
ads, and analyze website traffic. By continuing to use this website, you consent to our

Event Functions use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 19/52
22/4/2020 Simulink — Examples

Resettable Subsystems

What happens when a ramp signal


is integrated using two resettable
subsystems. After running the
simulation, the scope shows three

Messages

   
Animate and Understand Establish Message Send Model a Message Receive Use a Queue Block to
Sending and Receiving and Receive Interfaces Interface that Runs on Manage Messages
Messages Between Software… Message Availability
Send, receive, and visualize Model message-based Synchronize execution with data Use a Queue block to store and
messages. The example also shows communication between software availability in message-based queue messages. The Queue block
how to use Simulation Data components that run in different systems. We show how to model allows you to specify message

Inspector, Animation, and StorageThis website uses cookies
applications. to improve
The example also your user experience,
this behavior personalize
using events and contentstorage
and capacity, overwriting policy,
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 20/52
22/4/2020 Simulink — Examples

   

Modeling Message Build a Shared Model Wireless Message Model an Ethernet


Communication Patterns Communication Channel Communication with Communication Network
with SimEvents with Multiple Senders an… Packet Loss and Channel… with CSMA/CD Protocol
Create common communication Model communication through a Model wireless message Model an Ethernet communication
patterns using SimEvents®. In shared channel with multiple communication with packet loss and network with CSMA/CD protocol
message-based communication senders and receivers by using channel failure by using Simulink® using Simulink® messages and
models, you can use SimEvents® to Simulink® messages, SimEvents®, messages, Stateflow®, and SimEvents®. In the example, there

Schedule Model Components

 
Resettable Subsystems Block Priority

What happens when a ramp signal What happens when blocks are
is integrated using two resettable assigned different priorities. The
subsystems. After running the block priority affects the order in

simulation, the scope shows threeThis website
whichuses cookies
the blocks to improve
your user experience, personalize content and
are executed. You
ads, and analyze website traffic. By continuing to use this website, you consent to our

Nonlinearity use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 21/52
22/4/2020 Simulink — Examples

  

Interpolation Algorithm Using the Prelookup and Saving Memory in


Selection and Trajectory Interpolation Blocks Prelookup and
Animation Interpolation Blocks by…
Use a dynamic comet plot to The Prelookup block allows you to Save memory in Prelookup and
visualize the result of changing the minimize the number of index Interpolation blocks. The Prelookup
interpolation and extrapolation searches performed across a set of and Interpolation Using Prelookup
options for a 2-D data set running in look-up tables and also to mix blocks allow the data type storing

Multicore Processor Targets

   
Assigning Tasks to Cores Implement an FFT on a Multicore Programming of Multicore Deployment of a
for Multicore Programming Multicore Processor and a Field-Oriented Control on Plant Model
an FPGA Zynq
Take advantage of executing code Take advantage of a multicore Demonstrates how to implement a Illustrates how to take advantage of
on a multicore processor by processor target with FPGA control algorithm containing multiple executing multithreaded code on a
graphical partitioning. This example acceleration by graphically rates on Zynq. To take advantage of multicore processor using graphical
requires Simulink Coder™ to  This website uses acookies
partitioning to improve
model. This your
example user
both experience, personalize
the cores and the FPGA contentpartitioning.
and This example requires
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 22/52
22/4/2020 Simulink — Examples

   

Modeling Objects with Vectorizing a Scalar Tiled Processing of 2D Neighborhood Processing


Identical Dynamics Using Algorithm with For Each Signals with For Each Using For Each
For Each Subsystem Subsystem Subsystem Subsystems
Model multiple objects with identical Use the For Each Subsystem. In this Use the For Each Subsystem. In this Use the For Each Subsystem block
dynamics using the For Each example the operations are example the operations are to process submatrices data when
Subsystem. The number of objects performed on a vector for simplicity. performed on matrices. neighboring submatrices overlap
is parameterized by the length of the each other. To demonstrate this data

Configure Signals, States, and Parameters


Blocks

 
Migration to Structure Switch Between Sets of
Parameters Parameter Values During
Simulation and Code…
Convert a Simulink® model that is Switch between independent sets of


parameterized by unstructured
This
workspace variables to a model that
values for the same block
website uses cookies to improve youruser experience, personalize content and
parameters by storing the sets in an
ads, and array
analyze website traffic. By continuing to use this website, you consent to our
is parameterized by a MATLAB® of structures. 
use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.
Signals
https://es.mathworks.com/help/simulink/examples.html 23/52
22/4/2020 Simulink — Examples

   
Matrix Signals Variable-Size Signal Basic Variable-Size Signal Length Multimode Variable-Size
Operations Adaptation Signal

Use matrix and frame signals in How variable-size signals can be A hypothetical system where the How to use different operation
Simulink® diagrams. Through this generated and also illustrates some length of a signal changes over time modes to correspond to different
example, you can access models of the operations that can be applied by adapting to the changes of a signal sizes
that relate to the following practical to them. The purpose of this control signal.


Merging Signals

The following Simulink® concepts:

 This website uses cookies to improve your user experience, personalize content and
Data Types ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 24/52
22/4/2020 Simulink — Examples

 

Data Typing in Simulink Data Typing Filter

Use data types in Simulink. The How a filter can be applied to signals
model used in this example converts of different data types using
a double-precision sine wave having standard Simulink® blocks. In this
an amplitude of 150 to various data example, a signal with some noise

Model Configuration Sets


Automate Model
Configuration by Using a
Script
Write a script to programmatically
configure multiple models to use the
same configuration set.

This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use
Analyze and Remodel Design of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.
Run Model Advisor Checks
https://es.mathworks.com/help/simulink/examples.html 25/52
22/4/2020 Simulink — Examples


Model Advisor

The capabilities of the Model


Advisor to check a model or
subsystem for conditions and
configuration settings that can result

Transform Models
Discretization


Simulink Model Discretizer

This interactive example discretizes


the Actuator Model in an aircraft
Simulink® model.  This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Simulation change your settings.

https://es.mathworks.com/help/simulink/examples.html 26/52
22/4/2020 Simulink — Examples

  
Four Hydraulic Cylinder Simulation of a Bouncing Parallel Simulations Using
Simulation Ball Parsim: Parameter Sweep
in Rapid Accelerator Mode
Use Simulink® to create a model Use two different approaches to Run multiple simulations of a Monte
with four hydraulic cylinders. See modeling a bouncing ball using Carlo study in parallel by using
two related examples that use the Simulink®. Parallel Computing Toolbox™.
same basic components: single Parallel execution leverages the

Prepare Model Inputs and Outputs

   
Attaching Input Data to Logging States in Converting Harness-Driven Working with Big Data
External Inputs via Custom Structure Format Models to Use Harness-
Input Mappings Free External Inputs
Create a custom mapping function How logging state trajectories of a Convert a harness model that uses How Simulink models handle big
for the Root Inport Mapper tool. The Simulink® model in a structure a Signal Builder block as an input to data as input to and output from a
Root Inport Mapper tool associates format can be better than the a harness-free model with root simulation.

MAT-file data with a specific inputThis
website usesmethod
traditional cookies to improve
of logging states your user experience,
inports. The examplepersonalize
collects data content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Load Signal Data for Simulation
change your settings.

https://es.mathworks.com/help/simulink/examples.html 27/52
22/4/2020 Simulink — Examples

  

Using Mapping Modes with Load Input Data for a Bus Stream Data from a MAT-
Custom-Mapped External Using In Bus Element File as Input for a Parallel
Inputs Blocks Simulation
Implement a custom mapping Load input data for a bus using In Stream input data for parallel
algorithm similar to a Simulink Bus Element blocks. simulations from a MAT-file.
mapping mode. It uses the
getSlRootInportMap and

Save Run-Time Data from Simulation


Logging Intervals

Specify logging intervals. Simulink


limits the data logging to the
specified intervals.

This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of
Configure Simulation Conditions cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 28/52
22/4/2020 Simulink — Examples

   

Exploring Variable-Step Exploring the Solver Saving and Restoring Artificial Algebraic Loops
Solvers Using a Stiff Model Jacobian Structure of a Simulation Operating Point
Model
The behaviour of variable-step The example shows how to use The workflow and the benefits of An artificial algebraic loop occurs
solvers in a Foucault pendulum Simulink® to explore the solver saving and restoring a simulation when an atomic subsystem or Model
model. Simulink® solvers ode45, Jacobian sparsity pattern, and the operating point using a block causes Simulink to detect an
ode15s, ode23, and ode23t are connection between the solver ModelOperatingPoint object. algebraic loop, even though the

Run Simulations

  
Saving and Restoring Parallel Simulations Using Four Hydraulic Cylinder
Simulation Operating Point Parsim: Parameter Sweep Simulation
in Normal Mode
The workflow and the benefits of Run multiple simulations of a Monte Use Simulink® to create a model
saving and restoring a simulation Carlo study in parallel by using with four hydraulic cylinders. See
operating point using a Parallel Computing Toolbox™. two related examples that use the
ModelOperatingPoint object. 
This website uses
Parallel cookies
execution to improve
your
leverages the user
sameexperience, personalize
content and
basic components: single
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Load Signal Data for Simulation
change your settings.

https://es.mathworks.com/help/simulink/examples.html 29/52
22/4/2020 Simulink — Examples

Using Mapping Modes with


Custom-Mapped External
Inputs
Implement a custom mapping
algorithm similar to a Simulink
mapping mode. It uses the
getSlRootInportMap and

Run Multiple Simulations

   
Parallel Simulations Using Parallel Simulations Using Multiple Simulations Parallel Simulations Using
Parsim: Parameter Sweep Parsim: Parameter Sweep Workflow Tips Parsim: Test-Case Sweep
in Normal Mode in Rapid Accelerator Mode
Run multiple simulations of a Monte Run multiple simulations of a Monte The goal of this demo is to provide Run multiple Simulink® simulations
Carlo study in parallel by using Carlo study in parallel by using helpful tips for running multiple corresponding to different test cases
Parallel Computing Toolbox™. Parallel Computing Toolbox™. simulations using parallel simulation in the Signal Editor block using

Parallel execution leverages the This website uses
Parallel cookies
execution to improve
leverages the your user
tools.experience, personalize
This example will work even ifcontentSimulationInput
and objects and the
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 30/52
22/4/2020 Simulink — Examples

Rapid Accelerator
Simulations Using Parsim

The use of Rapid Accelerator in


applications that require running
parallel simulations for a range of
input and parameter values.

View and Analyze Simulation Results

 
Viewing Signals in Model Modeling a Fault-Tolerant
Reference Instances Fuel Control System

Use the Simulation Data Inspector to Combine Stateflow® with Simulink®


view and analyze signals in to efficiently model hybrid systems.
referenced models. The Simulation This type of modeling is particularly

Data Inspector relies on signal This website
usefuluses cookies
for systems thatto improve your
have user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

View Simulation Results use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 31/52
22/4/2020 Simulink — Examples

Control Scope Blocks


Programmatically

Control scopes with programming


scripts.

Inspect and Analyze Simulation Results

   
Viewing Signals in Model View and Replay Map Data Visualize Simulation Data Replay Data in the
Reference Instances on an XY Plot Simulation Data Inspector

Use the Simulation Data Inspector to You can add a map to your layout in View and inspect simulation data Replay data in the Simulation Data
view and analyze signals in the Simulation Data Inspector to using the XY visualization and Inspector to inspect and analyze
referenced models. The Simulation view routes of longitude and latitude replay controls. simulation behavior.

Data Inspector relies on signal This website
data. uses cookies
The map to improve your
user experience, personalize content and
data is synchronized
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 32/52
22/4/2020 Simulink — Examples

 

Analyze Data Using the XY Create an Interactive


Visualization Comparison Report

Analyze data using the XY Save and share Simulation Data


visualization and trend lines. Inspector comparison results in an
interactive web report.

Control Simulations with Interactive Displays

  
Modeling a Fault-Tolerant Create a Realistic Control a Parameter Value
Fuel Control System Dashboard Using the with Callback Button
Custom Gauge Block Blocks
Combine Stateflow® with Simulink® Use the Custom Gauge and Models control of a system that
to efficiently model hybrid systems. MultiStateImage blocks to create a consists of two masses attached on
This type of modeling is particularly realistic dashboard for your model. either side of a spring.
useful for systems that have This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Optimize Performance use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 33/52
22/4/2020 Simulink — Examples

  

Introduction to Rapid Accelerator Implement an FFT on a


Accelerating Models Simulations Using Parsim Multicore Processor and
an FPGA
Simulink® Accelerator™ speeds up The use of Rapid Accelerator in Take advantage of a multicore
the execution of your model, by applications that require running processor target with FPGA
creating and compiling C code that parallel simulations for a range of acceleration by graphically
takes the place of the interpretive input and parameter values. partitioning a model. This example

Acceleration

   
Introduction to Determining Why Simulink Parallel Simulations Using Parallel Simulations Using
Accelerating Models Accelerator Is Parsim: Parameter Sweep Parsim: Parameter Sweep
Regenerating Code in Normal Mode in Rapid Accelerator Mode
Simulink® Accelerator™ speeds up Sometimes Simulink® regenerates Run multiple simulations of a Monte Run multiple simulations of a Monte
the execution of your model, by the simulation target for a model at Carlo study in parallel by using Carlo study in parallel by using
creating and compiling C code that the beginning of a simulation in Parallel Computing Toolbox™. Parallel Computing Toolbox™.

takes the place of the interpretiveThis website uses Mode
Accelerator cookies
(TM)tobut
improve
your
it is not user experience,
Parallel personalize
execution leverages the contentParallel
and execution leverages the
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 34/52
22/4/2020 Simulink — Examples

Rapid Accelerator
Simulations Using Parsim

The use of Rapid Accelerator in


applications that require running
parallel simulations for a range of
input and parameter values.

Manual Performance Optimization

   
Model Advisor Simulink Model Discretizer Introduction to Profiling Parallel Simulations Using
Models Parsim: Test-Case Sweep

The capabilities of the Model This interactive example discretizes The following example, with the Run multiple Simulink® simulations
Advisor to check a model or the Actuator Model in an aircraft slAccelDemoF14 model, illustrates corresponding to different test cases
subsystem for conditions and Simulink® model. the use of Simulink® Accelerator™ in the Signal Editor block using
 This
configuration settings that can result website uses cookies to improve your user experience,
profiler feature. personalize contentSimulationInput
and objects and the
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 35/52
22/4/2020 Simulink — Examples

Multiple Simulations
Workflow Tips

The goal of this demo is to provide


helpful tips for running multiple
simulations using parallel simulation
tools. This example will work even if

Project Management

   
Automate Simulink Project Using a Project Perform Impact Analysis Running Custom Tasks
Tasks Using Scripts with a Project with a Project

Use the project API to automate Use an existing project to manage Perform file-level impact analysis Apply a custom task to a set of files
project tasks manipulating files, the files within your design. It shows using the Dependency Analyzer. It managed by project. The example
including working with modified files, how to automate startup and shows how to visualize project custom task analyzes the Simulink
 This
dependencies, shortcuts, and labels.
website uses cookies to improve your
shutdown tasks, add shortcuts for
user experience, personalize
structure, analyze project
content and
models which are in the project,
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
Project Setup
change your settings.

https://es.mathworks.com/help/simulink/examples.html 36/52
22/4/2020 Simulink — Examples

  

Using a Project Create and Reference a Using a Project with Git


Project Programmatically

Use an existing project to manage Programatically create a new project Use a project to manage the files
the files within your design. It shows and add it as a reference project in within your design. Starting with an
how to automate startup and your main project. It covers how to existing project that is already
shutdown tasks, add shortcuts for create a project from the command checked into source control, this

Project File Management

   
Automate Label Upgrade Simulink Models Convert from MDL to SLX Export a Subset of a
Management in a Project Using a Project in a Project and Preserve Project Using an Export
Revision History Profile
Use the project functions to manage Easily upgrade all the models in Export a release version of a project
labels. your project using the Upgrade using an export profile. The example
Project tool in a project. export profile streamlines the
 This website uses cookies to improve your user experience, personalize contentexported
and project by removing files
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 37/52
22/4/2020 Simulink — Examples

Automate Simulink Project


Tasks Using Scripts

Use the project API to automate


project tasks manipulating files,
including working with modified files,
dependencies, shortcuts, and labels.

Dependency Analysis


Perform Impact Analysis
with a Project

Perform file-level impact analysis


using the Dependency Analyzer. It
shows how to visualize project

This website uses cookies to improve your user experience, personalize content and
structure, analyze project
ads, and analyze website traffic. By continuing to use this website, you consent to our

Source Control in Projectsuse of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 38/52
22/4/2020 Simulink — Examples

   

Using a Project with Git Using a Project with SVN Resolve Conflicts with Convert from MDL to SLX
Simulink Three-Way Merge in a Project and Preserve
Revision History
Use a project to manage the files Use a project to manage the files Use Simulink® Three-Way Merge to
within your design. Starting with an within your design. Starting with an resolve conflicts in Simulink models.
existing project that is already existing project that is already uses You can view and merge the
checked into source control, this source control, this example shows Simulink model differences in the

Componentization of Large Projects

 
Create and Reference a Referencing Projects from
Project Programmatically Another Project

Programatically create a new project Use referenced projects as


and add it as a reference project in independent components within your
your main project. It covers how to project.

create a project from the command This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Model Comparison use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 39/52
22/4/2020 Simulink — Examples

  

Compare and Merge Compare and Merge Resolve Conflicts with


Simulink Models Simulink Models Simulink Three-Way Merge
Containing Stateflow
Use the comparison report in Use the comparison report in Use Simulink® Three-Way Merge to
MATLAB® to understand what has MATLAB® to understand what has resolve conflicts in Simulink models.
changed between two different changed between two different You can view and merge the
designs. It shows how to view and designs. It shows how to view and Simulink model differences in the

Block Authoring and Simulation Integration


Extend Modeling Functionality with Custom Blocks

  
Radar Tracking Using Custom Code and Hand System Identification for
MATLAB Function Block Coded Blocks using the S- an FIR System Using
function API MATLAB System Blocks
Use an extended Kalman filter with This library launches examples of Use the MATLAB System block to

the MATLAB® Function block in This website uses
different cookies
types to improve
of Simulink® S- your user experience,
implement Simulink®personalize
blocks using acontent
and
Simulink® to estimate an aircraft'sads, and functions.
analyzeSimulink
websiteS-functions allow
traffic. By System
continuing object™.
to use It highlightsyou
this website, two consent
to our
position from radar measurements. you to extend Simulink with new MATLAB System blocks. Access the

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 40/52
22/4/2020 Simulink — Examples

Implement Algorithms Using MATLAB


Integrate Basic Algorithms Using MATLAB Function Block

 
Spiral Galaxy Formation Radar Tracking Using
Simulation Using MATLAB MATLAB Function Block
Function Blocks
This model was inspired by the Use an extended Kalman filter with
classic paper "Galactic Bridges and the MATLAB® Function block in
Tails" (Toomre & Toomre 1972). The Simulink® to estimate an aircraft's
original paper explained how disc position from radar measurements.

Integrate System Objects Using MATLAB System Block

   
Implement a Simple MATLAB System Block System Identification for Illustration of Law of Large
Algorithm with Variable-Size Input an FIR System Using Numbers
and Output Signals MATLAB System Blocks
Use a simple System object in Use the MATLAB System block to Use the MATLAB System block to Use MATLAB System blocks to
 This
Simulink with the MATLAB System website
createuses cookies
Simulink® towith
blocks improve your user experience,
implement Simulink®personalize
blocks using acontentillustrate
and the law of large numbers.
block. ads, and variable-size
analyze website traffic.
input and output By continuing to use
System this website,
object™. It highlightsyou
two consent to our

signals. MATLAB System blocks.
use of cookies. Please see our Privacy Policy to learn more about cookies Access the and how to

change your settings.

https://es.mathworks.com/help/simulink/examples.html 41/52
22/4/2020 Simulink — Examples


Customize MATLAB
System Block Appearance

Customize the appearance of the


MATLAB System block.

Customize System Objects for Simulink

 
Create Moving Average Specify Sample Time for
Filter Block with System MATLAB System Block
object System Objects
Modify a System object to use it in Control the sample time of the
Simulink. MATLAB System block using
System object™ methods.

This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Implement Blocks with System Objects
use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 42/52
22/4/2020 Simulink — Examples

   

Implement a Simple Customize MATLAB Break Algebraic Loops Customize MATLAB


Algorithm System Block Dialog System Block Appearance

Use a simple System object in Customize the block dialog for a Create a MATLAB System block that Customize the appearance of the
Simulink with the MATLAB System MATLAB System block. can break an algebraic loop in the MATLAB System block.
block. model.

  
Implement Algorithm with Implement Algorithm that Specify Output
Tunable Parameters Calls External C Code Characteristics of MATLAB
System Block
Implement an algorithm with tunable Use external C code in a System Specify output size, data type and
parameters by using a MATLAB object. complexity of a MATLAB System
System block. block.

 This website uses cookies to improve your user experience, personalize content and
Implement Algorithms Using C/C++ Codeanalyze website traffic. By continuing to use this website, you consent to our
ads, and

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 43/52
22/4/2020 Simulink — Examples

  

Call C Functions Using C Bring Custom Image Filter Custom Code and Hand
Caller Block Algorithms as Reusable Coded Blocks using the S-
Blocks in Simulink function API
Use the C Caller block to call your Bring in C code image filter This library launches examples of
handwritten C functions. algorithms using C Caller blocks in a different types of Simulink® S-
reusable Simulink library. functions. Simulink S-functions allow
you to extend Simulink with new

Call C Code Using C Caller Block

  
Call C Functions Using C Bring Custom Image Filter Call a Legacy Lookup
Caller Block Algorithms as Reusable Table Function Using C
Blocks in Simulink Caller block
Use the C Caller block to call your Bring in C code image filter Use the C Caller block to call legacy
handwritten C functions. algorithms using C Caller blocks in a C functions that implement N-
reusable Simulink library. dimensional table lookups.

This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our
Integrate External C Algorithms Using C Function Blocks 
use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 44/52
22/4/2020 Simulink — Examples

   

Start and Terminate Call C++ Class Methods Call Legacy Lookup Table Modify States of a C
Actions Within a C Using a C-style Wrapper Functions Using C Function Block Using
Function Block Function From a C… Function Block Persistent Symbols
Use the C Function block to Use the C Function block to call C++ Use the C Function block to call Define an initial persistent value to
integrate legacy C functions that class methods using a C-style legacy C functions that implement cache in the block.
have start and terminate actions. wrapper function. N-dimensional table lookups.

   
Change Values of Signals Define an Alias Type in a C Use Inherited Sizes in a C Use Enumerated Data in a
Using C Function Block Function Block Function Block C Function Block
and Buses
Use Bus signals with a C Function Add symbols whose data types are Use a C Function block to compute Use the C Function block to define
block. defined by Alias types. a scaled vector dot product from two traffic lights as enumerated
input vectors. constants.

 This website uses cookies to improve your user experience, personalize content and
Implement C/C++ S-Functions
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 45/52
22/4/2020 Simulink — Examples

Custom Code and Hand


Coded Blocks using the S-
function API
This library launches examples of
different types of Simulink® S-
functions. Simulink S-functions allow
you to extend Simulink with new

Debug and Analyze the Quality of S-Functions


Run Quality Checks on S-
Functions

Demonstrates how to use S-


Function analyzer APIs to check S-
functions, in order to identify
potential problems and  This
website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

Implement C/C++ Code Using S-Function Builder Please see our Privacy Policy to learn more about cookies and how to
use of cookies.
change your settings.

https://es.mathworks.com/help/simulink/examples.html 46/52
22/4/2020 Simulink — Examples

Custom Code and Hand


Coded Blocks using the S-
function API
This library launches examples of
different types of Simulink® S-
functions. Simulink S-functions allow
you to extend Simulink with new

Implement Algorithms Using Legacy Code Tool

   
Inputs Passed by Value or Output Passed by Return Fixed Point Signals in Fixed Point Parameters in
Address to Legacy Argument from Legacy Legacy Functions Legacy Functions
Functions Functions
Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to
integrate legacy C functions that integrate legacy C functions that integrate legacy C functions that integrate legacy C functions that
pass their input arguments by value pass their output as a return pass their inputs and outputs using pass their inputs and outputs using
versus address.  This website uses cookies to improve your user
argument. experience,
signals of fixed pointpersonalize
data type. contentparameters
and of fixed point data type.
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 47/52
22/4/2020 Simulink — Examples

   

Lookup Tables Start and Terminate Using Buses with Legacy Inherited Signal
Implemented in Legacy Actions Within Legacy Functions Having Dimensions for Legacy
Functions Functions Structure Arguments Function Arguments
Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to
integrate legacy C functions that integrate legacy C functions that integrate legacy C functions with integrate legacy C functions whose
implement N-dimensional table have start and terminate actions. structure arguments using arguments have inherited
lookups. Simulink® buses. dimensions.

   
C++ Object Methods as Persistent Memory Within Multi-Dimensional Signals Complex Signals in Legacy
Legacy Functions Legacy Functions in Legacy Functions Function

Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to Use the Legacy Code Tool to
integrate legacy C++ object integrate legacy C functions with integrate legacy C functions with integrate legacy C functions using
methods. instance specific persistent memory. Multi-Dimensional Signals. complex signals.

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 48/52
22/4/2020 Simulink — Examples

Specified or Inherited
Sample Time with Legacy
Functions
Use the Legacy Code Tool to
integrate legacy C functions with the
sample time specified, inherited and
parameterized.

Integrate with Existing Simulation or Environment

 
Importing a Co-Simulation Multithread Co-Simulation
FMU into Simulink

How to use the FMU Import block to Run co-simulation on multiple


load an FMU file. The FMU file threads.
supports execution in co-simulation

mode. Simulink supports steppingThis website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

FMU Importing use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 49/52
22/4/2020 Simulink — Examples

  

Importing a Co-Simulation Importing a Model Using Bus Signals and


FMU into Simulink Exchange FMU into Structure Parameters in
Simulink the FMU Import Block
How to use the FMU Import block to How to use the FMU Import block to How to use bus signals and
load an FMU file. The FMU file load an FMU file. The FMU file structure parameters in an FMU
supports execution in co-simulation supports execution in Model Import block. The FMU supports
mode. Simulink supports stepping Exchange mode. execution in Model Exchange mode.

Co-Simulation

 
Co-Simulation Signal Multithread Co-Simulation
Compensation

Use co-simulation and signal Run co-simulation on multiple


compensation for interfacing signals. threads.


This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please
Create, Organize, and Publish Custom Blocksets see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 50/52
22/4/2020 Simulink — Examples

Streamline Simulink
Blockset Authoring
Process with Blockset…
Manage artifacts associated with a
Simulink blockset with a single
Blockset Designer Project.

Create Block Masks

   
Promote Block Parameters Design a Mask Dialog Box Mask a Variant Subsystem Create a Block Mask Icon
on a Mask using the Parameters &
Dialog Pane
Promote underlying block Try this example to create a mask Recommended way to mask a Create icons on mask using drawing
parameters on to a mask. dialog box and understand the use Variant Subsystem block. commands.
of some Mask Editor features.
 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 51/52
22/4/2020 Simulink — Examples

Create a Custom Table on


Mask dialog box

Create a custom table on a mask


dialog box.

 This website uses cookies to improve your user experience, personalize content and
ads, and analyze website traffic. By continuing to use this website, you consent to our

use of cookies. Please see our Privacy Policy to learn more about cookies and how to
change your settings.

https://es.mathworks.com/help/simulink/examples.html 52/52

You might also like