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
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
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
Create a custom mapping function for the Root Inport Mapping tool. The Root Inport Mapper 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.
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
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
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.
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,
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.
Create and use a protected model in Normal and Accelerated mode simulations, as well as for code generation.
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
Use a Simulink Project to manage the files within your design. Starting with an existing project that is already checked into source control, this example shows how to find and manage the
Use the Simulink Project dependency analysis tools to perform file-level impact analysis. Starting with an existing project that is already checked into SVN source control, this example
Use the MATLAB System block to create Simulink® blocks with variable-size input and output signals.
Use the Legacy Code Tool to integrate a C function whose arguments are pointers to structures.
Create a mask dialog box using the Parameters & Dialog pane of the Mask Editor. When you mask a block, you encapsulate the block logic and create a custom interface for the block.
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
A Subsystem can be virtual or atomic. Simulink propagates variant conditions differently to such Subsystems. This example shows the propagation of variant conditions from Inline
A conditional subsystem (also known as a conditionally executed subsystem) is a type of subsystem where you can control the execution using an external signal.
When you select the Propagate conditions outside of variant subsystem check box in the Block Parameters dialog box, the Variant Subsystem adapts its interface to the connected blocks.
Use the Simulink project API to automate project tasks manipulating files, including working with modified files, dependencies, shortcuts, and labels.
Change a block parameter value between multiple programmatic simulation runs. Use this technique to determine an optimal parameter value by comparing the output signal data of each run.
Compare runs of simulation data and access the comparison results with the Simulation Data Inspector API.
Create a run, add data to it, and then view the data in the Simulation Data Inspector.
Create reports using the Simulation Data Inspector programmatic interface. You can create a report for plotted signals in the Inspect pane or for comparison data in the Compare pane. This
Uses the slexAircraftExample model to demonstrate the comparison of a control system's input and output signals. The example marks the signals for streaming then gets the run object for a
The capability of using the Simulink.HMI.InstrumentedSignals object to save a set of logged signals to restore after running a simulation with a different set of signals.
Continues from docid:simulink_ug.bso7lpv. You can also use this script to generate the data required for the example.
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 an image processing application - color detection by using Simulink Support Package for Android™ Devices.
Use Audio File Read 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 to build a surveillance camera.
Use sliders and buttons from Simulink Support Package for Android® Devices to develop a interactive system for color replacement application
Use the Accelerometer sensor data of an Android™ device to control the motion of a LEGO® MINDSTORMS® EV3 robot.
Plot real-time data on an Android device by using the Simulink® Scope block with Simulink Support Package for Android Devices.
Control the brightness of the Arduino LED from an Android device.
Configure your Android™ device to send data over Bluetooth Low Energy(BLE) Protocol and receive that data on another Android device using the Simulink® Android BLE blocks.
Create an Android™ app using Simulink® Support Package for Android Devices with Audio System Toolbox™ to implement a parametric audio equalizer.
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
Develop a Simulink model for an image processing application - color detection by using Simulink® Support Package for Apple iOS Devices.
Control the brightness of an Arduino LED from an Apple iOS device.
Use the Accelerometer sensor data of an Apple iOS device to control the motion of a LEGO® MINDSTORMS® EV3 robot.
Connect an Apple iOS device to a LEGO® MINDSTROMS® EV3
Plot real-time data on an Apple iOS device by using the Simulink® Scope block with Simulink Support Package for Apple iOS Devices.
Use Simulink Support Package for Arduino hardware to receive and send TCP/IP or UDP messages over WiFi using Arduino boards.
Use Simulink Support Package for Arduino Hardware to run a Simulink® model on Arduino board.
Create a line follower algorithm in Simulink® and how to run it on an Arduino Robot.
Simulate a simple closed-loop control algorithm in Simulink® and how to run it on an Arduino® board.
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.
Use Simulink Support Package for Arduino Hardware for code verification and validation using PIL.
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 create a Simulink model to implement a smart plant watering system based on ThingSpeak.
Control the brightness of the Arduino LED from an Apple iOS device.
Use Simulink® Support Package for Arduino Hardware to configure and read temperature from an I2C based sensor.
Simulate a simple closed-loop control algorithm in Simulink® and how to run it on LEGO® MINDSTORMS® EV3™ hardware.
Tune the parameter values of and monitor the signals from an algorithm running on LEGO MINDSTORMS EV3 hardware.
Implement a line tracking algorithm for a two-wheeled robot built with LEGO® MINDSTORMS® EV3™ hardware.
Use Simulink Support Package for LEGO MINDSTORMS EV3 Hardware to run a Simulink® model on LEGO MINDSTORMS EV3 hardware.
Create a Simulink model to communicate between the Host PC and the LEGO MINDSTORMS EV3 robot. The Simulink model running on the Host PC will exchange data with the EV3 brick and control the
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 to build a surveillance camera.
Tune the parameters and monitor the signals of an algorithm running on Raspberry Pi board.
Read the Accelerometer on Raspberry Pi Sense HAT and use this data to control the motion of a LEGO MINDSTORMS EV3 robot.
Use Simulink® Support Package for Raspberry Pi Hardware to read from and write to an SPI EEPROM.
Develop a Simulink model to implement an algorithm to read the Accelerometer On-board Sense HAT and control the rotation of the image displayed on the LED matrix.
Illustrates how to use Simulink® Support Package for Raspberry Pi Hardware to configure and read temperature from a TMP102 sensor.
Log signals from a Simulink® model on Raspberry Pi™ hardware in the MAT-file format.
Demonstrates an application that counts the number of steps a person walked while holding a Raspberry Pi™ Sense HAT.
Examples to use the Simulink model kalmanfilter. By Yi Cao at Cranfield University on 25 January 2008
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 demonstration shows how you can customize the Simulink graphical user interface (GUI).
- Low speed model is not perfect, review the effect on pneumatic trail (t) and aligning torque (Mz) - Turn slip equations needs to be reviewed, specially for Mz
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 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
Examples to run the Simulink model kalmanbucy in the command window. By Yi Cao at Cranfield University on 28 January 2008
Illustrates a MATLAB® Coder™ based workflow for running MATLAB code on Raspberry Pi. MATLAB Coder generates readable and portable C / C++ code from MATLAB code, supporting most of the MATLAB
Illustrates a workflow for modeling an audio processing application in MATLAB and deploying C/C++ code to create a standalone application on a Raspberry Pi. MATLAB coder generates
Use a Bus to Vector block to convert a bus signal to a vector, to provide a signal that the Gain block can accept.
Adding In Bus Element and Out Bus Element blocks to create bus element ports in a subsystem for selecting signals from an input bus and creating an output bus signal.
Use the Callback Button block to perform initialization routines on your model.
Use a Bus Assignment block to change a bus element value without adding Bus Selector and Bus Creator blocks to select bus elements and reassemble them into a bus.
Models control of a system that consists of two masses attached on either side of a spring. A control loop damps the oscillation of the spring that results when an external force acts on the
Consider a point mass m suspended by a massless rod of length l under the influence of gravity. The position of the mass can be expressed in in Cartesian coordinates by (x,y).