Use two different approaches to modeling a bouncing ball using Simulink®.
How zero crossings work in Simulink®. In this model, three shifted sine waves are fed into an absolute value block and saturation block. At exactly t = 5, the output of the switch block changes
Approximate nonlinear relationships of a type S thermocouple.
Use Simulink® to model a hydraulic cylinder. You can apply these concepts to applications where you need to model hydraulic behavior. See two related examples that use the same basic
Use Simulink® to create the thermal model of a house. This system models the outdoor environment, the thermal characteristics of the house, and the house heating system.
Model an inverted pendulum. The animation is created using MATLAB® Handle Graphics®. The animation block is a masked S-function. For more information, use the context menu to look under the
Model a double spring-mass-damper system with a periodically varying forcing function. Associated with the example is an animation function that will automatically open a figure window
This model was inspired by the classic paper "Galactic Bridges and Tails" (Toomre & Toomre 1972). The original paper explained how disc shaped galaxies could develop spiral arms. Two disc
Use Simulink® to create a model with four hydraulic cylinders. See two related examples that use the same basic components: single cylinder model and model with two cylinders and load
Some of the main steps needed to design and evaluate a sine wave data table for use in digital waveform synthesis applications in embedded systems and arbitrary waveform generation
Model the dynamics of liquid in a tank. The associated animation provides a graphical display of the tank as it empties and refills, based on user-defined tank parameters. The tank empties at
Solve the differential equations for the Foucault Pendulum problem and displays the pendulum bob movement in the VRML scene. You can modify the Pendulum location by changing the Latitude /
Use Stateflow® to model a bang-bang temperature control system for a boiler. The boiler dynamics are modeled in Simulink®.
Model a rigid rod supporting a large mass interconnecting two hydraulic actuators. The model eliminates the springs as it applies the piston forces directly to the load. These forces
Choose the correct zero-crossing location algorithm, based on the system dynamics. For Zeno dynamic systems, or systems with strong chattering, you can select the adaptive zero-crossing
Use Flip-Flop blocks (found in the Simulink® Extras Library) to implement a Modulo-4 counter. The model takes the output of a Modulo-4 counter and generates a half clock cycle width pulse on
Model a Foucault pendulum. The Foucault pendulum was the brainchild of the French physicist Leon Foucault. It was intended to prove that Earth rotates around its axis. The oscillation plane
Model friction one way in Simulink®. The two integrators in the model calculate the velocity and position of the system, which is then used in the Friction Model to calculate the friction
The example shows how to use Simulink® to explore the solver Jacobian sparsity pattern, and the connection between the solver Jacobian sparsity pattern and the dependency between
Two cases where you can use Simulink® to model variable transport delay phenomena.
This model shows the contrast between enabled subsystems and triggered subsystems for the same control signal, through the use of counter circuits. After running the simulation, the scope
The behaviour of variable-step solvers in a Foucault pendulum model. Simulink® solvers ode45, ode15s, ode23, and ode23t are used as test cases. Stiff differential equations are used to
Handle state events. Run the simulation and see the phase plane plot, where the state x1 is along the X-axis and the state x2 is along the Y-axis.
Combine Stateflow® with Simulink® to efficiently model hybrid systems. This type of modeling is particularly useful for systems that have numerous possible operational modes based on
Simulate the working of an automatic climate control system in a car using Simulink® and Stateflow®. You can enter a temperature value you would like the air in the car to reach by double
Model an automotive drivetrain with Simulink®. Stateflow® enhances the Simulink model with its representation of the transmission control logic. Simulink provides a powerful
Simulate the electrical system of a vehicle using Simulink® and Simscape™ Power Systems™.
Model a simplified half-car model that includes an independent front and rear vertical suspension. The model also includes body pitch and bounce degrees of freedom. The example provides a
Interface the vehicle climate control system with a model of the electrical system to examine the loading effects of the climate control system on the entire electrical system of the car.
Model a simple model for an Anti-Lock Braking System (ABS). It simulates the dynamic behavior of a vehicle under hard braking conditions. The model represents a single wheel, which may be
Enhance a version of the open-loop engine model (sldemo_engine - described in "Modeling Engine Timing Using Triggered Subsystems" example). This model, sldemo_enginewc, contains a
Model a four-cylinder spark ignition internal combustion engine from the throttle to the crankshaft output. We used well-defined physical principles supplemented, where appropriate,
Use data dictionaries to manage the data for a fuel rate control system designed using Simulink® and Stateflow®. To familiarize yourself with the fuel rate control model see
Use MathWorks® software and the Model-Based Development process to go from concept to implementation for a power window system for an automobile.
Use Simulink® to model and simulate a rotating clutch system. Although modeling a clutch system is difficult because of topological changes in the system dynamics during lockup, this
Use the model of the missile airframe presented in a number of published papers (References ,  and ) on the use of advanced control methods applied to missile autopilot design. The
Use an extended Kalman filter with the MATLAB® Function block in Simulink® to estimate an aircraft's position from radar measurements. The filter implementation is found in the MATLAB
Model a conceptual air traffic control (ATC) radar simulation based on the radar range equation.
Use the Control System Toolbox™ and Simulink® Control Design™ to interact with Simulink to design a digital pitch control for the aircraft. In this example, we will design the controller to
Model six degrees of freedom motion in Simulink®. You can switch between using Euler Angles and Quaternions to model the equations of motion, using the Variant Subsystem block's "Variant >
How one of the engineers who worked on the Apollo Lunar Module digital autopilot design team would have done it using Simulink® if it had been available in 1961.
Model flight control for the longitudinal motion of an aircraft. First order linear approximations of the aircraft and actuator behavior are connected to an analog flight control design
Generate a movie with 64 frames and a frame size of 64 by 64 pixels (at 10 frames per second). The movie contains a simulation of a moving target that is moving through a structured background
Use anti-windup schemes to prevent integration wind-up in PID controllers when the actuators are saturated. We use the PID Controller block in Simulink® which features two built-in
Regulate the speed of an electric motor using two degrees-of-freedom PID control with set-point weighting. We use the PID Controller (2DOF) block in Simulink® as shown below.
How clients, in this case three computers, can send jobs to a server, a printer, and receive status from that server. This example highlights how Simulink Functions can be called from
How the Simulink® Project's checks support upgrading from MDL format model files to SLX format. The default file format for Simulink models in R2012b and subsequent releases is SLX.
Convert a Simulink® model that is parameterized by unstructured workspace variables to a model that is parameterized by a MATLAB® structure. The example uses a number of Simulink utilities
This interactive example discretizes the Actuator Model in an aircraft Simulink® model.
Use MATLAB System blocks to illustrate the law of large numbers.
This set of examples shows different types of Simulink® Subsystems and what semantics are used when simulating these Subsystems. Each example provides a description of the model and the
This library launches examples of different types of Simulink® S-functions. Simulink S-functions allow you to extend Simulink with new hand coded blocks, interface to custom external
Run multiple Simulink® simulations of a Monte Carlo study in parallel by using Parallel Computing Toolbox™ with Rapid Accelerator. Before running this example, make sure you are in a
Use Model Reference. It walks you through simulation and code generation of a model that references another model multiple times.
Convert a harness model that uses a Signal Builder block as an input to a harness-free model with root inports. The example collects data from the harness model and stores it in MAT-files, for
Use data types in Simulink. The model used in this example converts a double-precision sine wave having an amplitude of 150 to various data types and displays the converted signals on two
Create a custom mapping function for the Root Inport Mapping tool. The Root Inport Mapping tool associates MAT-file data with a specific input port, based on one of these criteria.
Use the Legacy Code Tool to integrate legacy C functions that pass their input arguments by value versus address.
What happens when a sine wave is fed into an If block. After running the simulation, the scope shows three plots. This example is designed to compare the If block with enabled subsystems.
Use the MATLAB System block to implement Simulink® blocks using a System object™. It highlights two MATLAB System blocks. Access the MATLAB source code for each System object by clicking the
Simulink® Accelerator™ speeds up the execution of your model, by creating and compiling C code that takes the place of the interpretive code that Simulink uses when in Normal mode (that is,
Run multiple Simulink® simulations corresponding to different test cases in the Signal Builder block, in parallel by using the Parallel Computing Toolbox™. This involves five main steps:
The Prelookup block allows you to minimize the number of index searches performed across a set of look-up tables and also to mix clipping, extrapolation, and index search algorithms within
Use the Legacy Code Tool to integrate legacy C functions that pass their output as a return argument.
Use a dynamic comet plot to visualize the result of changing the interpolation and extrapolation options for a 2-D data set running in an-D Lookup Table block. Algorithm options can be
Create and use a protected model in Normal and Accelerated mode simulations, as well as for code generation.
Use the Legacy Code Tool to integrate a handwritten C function whose arguments are pointers to structures.
Use Simulink® variant subsystems to generate C preprocessor conditionals that control which child subsystem of the variant subsystem is active in the generated code produced by the
Define variant choice regions in the Variant Source and Sink blocks based on the block connectivity. The variant choice regions are computed by Simulink when you update diagram (Simulation
When you use Simulink.LookupTable objects to store and configure lookup table data for ASAP2 or AUTOSAR code generation (for example, STD_AXIS or CURVE), you can configure the objects as
Use Simulink® Support Package for Android™ Devices to design an algorithm and augment the same with a custom GUI.
Use Simulink® Support Package for Android Devices to run a Simulink model on an Android device.
Use blocks from the Simulink Support Package for Android Devices to create a Simulink® model and run it on an Android device.
Tune the parameters and monitor the signals of an algorithm running on an Android device.
Develop a Simulink® model for a image processing application - color detection by using Simulink Support Package for Android™ Devices.
Use Audio Capture and Audio Playback blocks from the Simulink® Support Package for Android™ Devices to implement a parametric audio equalizer algorithm with a Simulink model and run the
Use FromApp block from Simulink Support Package for Android™ Devices to receive data and add a touch interface in an Android application. This example demonstrates a workflow to customize
Use Raspberry Pi hardware board and an Android™ device, such as Samsung® smartphones and tablets, to build a surveillance camera.
Use Audio Capture and Audio Playback blocks from the Simulink® Support Package for Apple iOS Devices to implement a parametric audio equalizer algorithm with a Simulink model and run the
Use Simulink® Support Package for Apple iOS Devices to design an algorithm and augment the same with a custom GUI.
Tune the parameters and monitor the signals of an algorithm running on an iOS device like iPhone, iPad or iPod.
Use blocks from the Simulink® Support Package for Apple iOS Devices to create a Simulink model and run it on an iPhone, iPod or an iPad.
Use Simulink Support Package for Apple iOS Devices to run a Simulink® model on an iPhone, iPod or an iPad.
Use Raspberry Pi® hardware and an Apple iOS device, such as iPhone or iPad, to build a surveillance camera.
Use FromApp block from Simulink® Support Package for Apple iOS Devices to receive data and add touch interface in an iOS application. This example demonstrates a workflow to develop
Use sliders and buttons from Simulink® Support Package for Apple iOS Devices to develop an interactive system for color replacement application
Use Simulink® Support Package for Arduino Hardware to enable and write to/ read from an SPI based EEPROM.
Use Simulink Support Package for Arduino hardware to receive and send TCP/IP or UDP messages using an Arduino board with a WiFi Shield.
Use Simulink® Support Package for Arduino Hardware to configure and read temperature from an I2C based sensor.
Use Simulink Support Package for Arduino Hardware to run a Simulink® model on Arduino board.
Simulate a simple closed-loop control algorithm in Simulink® and how to run it on an Arduino® board.
Create a line follower algorithm in Simulink® and how to run it on an Arduino Robot.
Tune the parameters and monitor the signals of an algorithm running on Arduino board.
Use Simulink Support Package for Arduino hardware to receive and send TCP/IP or UDP messages using an Arduino with an Ethernet Shield.
Simulate a simple closed-loop control algorithm in Simulink® and how to run it on LEGO® MINDSTORMS® EV3™ hardware.
Implement a line tracking algorithm for a two-wheeled robot built with LEGO® MINDSTORMS® EV3™ hardware.
Tune the parameter values of and monitor the signals from an algorithm running on LEGO MINDSTORMS EV3 hardware.
Implementation of a controller for a self-balancing two-wheel robot built with LEGO® MINDSTORMS® NXT™ hardware. The example illustrates basic concepts of balance and drive control using
A Rubik's Cube® solver based on LEGO® MINDSTORMS® NXT™ 2.0 hardware. This Rubik's Cube solver was initially developed by Hans Andersson in
Simulate a simple closed-loop control algorithm in Simulink® and how to run it on LEGO® MINDSTORMS® NXT™ hardware.
Use Simulink Support Package for LEGO MINDSTORMS NXT Hardware to run a Simulink® model on a LEGO MINDSTORMS NXT hardware.
Tune the parameters and monitor the signals of an algorithm running on LEGO MINDSTORMS NXT hardware.
Use Raspberry Pi® hardware to interface to a motion sensor and control an external LED.
Use Simulink Support Package for Raspberry Pi Hardware to run a Simulink® models on Raspberry Pi hardware.
Use ALSA Audio Playback block from the Raspberry Pi® block library to implement a parametric audio equalizer algorithm with a Simulink® model and to run the model on Raspberry Pi hardware.
Use the V4L2 Video Capture and the SDL Video Display blocks from the Raspberry Pi® block library to implement an image inversion algorithm with a Simulink® model, and to run the model on
Use Raspberry Pi® hardware and an Apple iOS device, such as iPhone or iPad, to build a surveillance camera.
Stream images captured from a webcam on Raspberry Pi board to the host computer using ROS communication interface.
Generate and build a standalone ROS node from a Simulink model on the Raspberry Pi hardware.
Use Raspberry Pi® hardware and an Android device, such as Samsung® smartphones and tablets, to build a surveillance camera.
Examples to use the Simulink model kalmanfilter. By Yi Cao at Cranfield University on 25 January 2008
Examples to run the Simulink model kalmanbucy in the command window. By Yi Cao at Cranfield University on 28 January 2008
This demonstration shows how you can customize the Simulink graphical user interface (GUI).
This demo shows how a model of a variable-step solver can be exploited to make stiff hybrid dynamic systems amenable to model checking technology. Specifically, a feedforward control
This page provides examples of the commands needed to find library links in a model. For a graphical way to investigate library links, see the Model Advisor.
This script file will show the following: 1) How to interrogate Simulink's state definition 2) leveraging Simulink's state definition to map to your own 3) aligning state definition with