MATLAB Examples

Use Simulink® to model a quadcopter, based on the PARROT® series of mini-drones.

This model shows how to use MathWorks® products to address the technical and process challenges of aircraft design using the design of a lightweight aircraft.

This model shows the simulation of multiple aircraft in formation flight, with emphasis on the necessary requirements and the realized benefits in making the simulation vectorized so that

This document describes how to use the Flight Simulation project template using Simulink® Projects. This template provides a framework for the collaborative development of a flight

This model shows how to model the Wright Brother's 1903 Flyer modeled in Simulink®, Aerospace Blockset™ and Simulink® 3D Animation™ software. This model simulates the longitudinal motion

This model shows how to model the DeHavilland Beaver using Simulink® and Aerospace Blockset™ software. It also shows how to use a pilot's joystick to fly the DeHavilland Beaver This model has

This model shows how to compute true airspeed from indicated airspeed using the Ideal Airspeed Correction block. The Aerospace Blockset™ blocks are indicated in red.

Trim and linearize an airframe using Simulink® Control Design™ software

This model shows how to compute the indicated airspeed from true airspeed using the Ideal Airspeed Correction block. The Aerospace Blockset™ blocks are indicated in red.

This model shows how to compare the implementation of a state-space controller [A,B,C,D] in a self-conditioned form versus a typical state-space controller [A,B,C,D]. This model

This model shows how to estimate a quaternion and model the equations in the following ways:

This model shows how to implement various gravity models with precessing reference frames using Aerospace Blockset™ blocks. The Aerospace Blockset blocks are shown in red.

Trim and linearize an airframe in the Simulink® environment using the Control System Toolbox™ software

This model shows how to connect an Aerospace Blockset™ six degree of freedom equation of motion block.

This project shows how to model NASA's HL-20 lifting body with Simulink®, Stateflow® and Aerospace Blockset™ software. The vehicle model includes the aerodynamics, control logic, fault

This model shows how to model the Wright Brother's 1903 Flyer modeled in Simulink®, and Aerospace Blockset™ software. This model simulates the longitudinal motion of the Flyer in response

How the Sphero Connectivity Package can be used to connect to a Sphero device and perform basic operations on the hardware, such as change the LED color, calibrate the orientation of the robot

Control the motion of a Sphero using the Sphero Connectivity Package

Describes the Simulink library for the Sphero Connectivity package, and how the blocks from the library can be used to control a Sphero.

Sphero is not listed under available devices when creating the sphero object, or the following error is received:

This model shows NASA's HL-20 lifting body and controller modeled in Simulink® and Aerospace Blockset™ software. This model simulates approach and landing flight phases using an

This model shows NASA's HL-20 lifting body and controller modeled in Simulink®, Aerospace Blockset™, and Simulink® 3D Animation™ software. This model simulates approach and landing

Automatically tune a PID Controller block using PID Tuner.

Tune a PID controller for plants that cannot be linearized. You use the PID Tuner to identify a plant for a buck converter. Then tune the PID controller using the identified plant.

Obtain a Linear Parameter Varying (LPV) approximation of a Simscape Power Systems™ model of a Boost Converter. The LPV representation allows quick analysis of average behavior at various

Use Simulink Control Design, using a drum boiler as an example application. Using the operating point search function, we illustrate model linearization as well as subsequent state

Tune multiple compensators (feedback and prefilter) to control a single loop.

Design a PI controller with frequency response estimated from a plant built in Simulink. This is an alternative PID design workflow when the linearized plant model is invalid for PID design

Design an array of PID controllers for a nonlinear plant in Simulink that operates over a wide range of operating points.

Plot linearization of a Simulink model at particular conditions during simulation. The Simulink Control Design software provides blocks that you can add to Simulink models to compute and

Model computational delay and sampling effect using Simulink Control Design.

Use Simulink Control Design from command line. The MATLAB functions available in Simulink Control Design software allow for the programmatic specification of the input and output points

Generate an array of LTI models that represents the plant variations of a control system from a Simulink model. This array of models is used in the Control System Designer for control design.

Obtain the frequency response of Simulink models when analytical block-by-block linearization does not provide accurate answer due to event-based dynamics in the linearization path.

Linearize an engine speed model.

Tune two cascaded feedback loops using Simulink Control Design.

Use the frequency response estimation to perform a sinusoidal-input describing function analysis, for a model with a saturation nonlinearity.

Specify the rate conversion method for the linearization of a multirate model. The choice of rate conversion methodology can affect the resulting linearized model. This example

Use the time based operating point snapshot feature in Simulink Control Design. This example uses a model of the dynamics of filling a cylinder with compressed air.

The process that the command linearize uses when extracting a linear model of a nonlinear multirate Simulink model. To illustrate the concepts, the process is first performed using

Specify the linearization of a Simulink block or subsystem.

Enable custom masked subsystems in Control System Designer. Once configured, you can tune a custom masked subsystem in the same way as any supported blocks in Simulink Control Design. For

The use of the operating point search and snapshot features along with the linearization of a Simscape Multibody model. (Requires Simscape Multibody)

Use the slLinearizer interface to batch linearize a Simulink model. You vary model parameter values and obtain multiple open- and closed-loop transfer functions from the model.

Linearize a Simulink model with delays in it.

Estimate the parameters of a multi-domain DC servo motor model constructed using various physical modeling products.

Use numerical optimization to tuning the controller parameters of a nonlinear system. In this example, we model a CE 152 Magnetic Levitation system where the controller is used to position a

Automatically generate a MATLAB function to solve a Design Optimization problem. You use the Response Optimization tool to define an optimization problem for a hydraulic cylinder design

Use Simulink® Design Optimization™ to optimize the controller of an inverted pendulum. The inverted pendulum is on a cart and the motion of the cart is controlled. The controller's

Use Simulink® Design Optimization™ to estimate multiple parameters of a model by iterated estimations.

Use parallel computing to optimize the time-domain response of a Simulink® model. You use Simulink® Design Optimization™ and Parallel Computing Toolbox™ to tune the gains of a discrete PI

Use Simulink® Design Optimization™ to tune the gains of the PID controller (Kp, Ki, and Kd) and optimize the step response of the plant. To view the results, use the following steps.

Use Simulink® Design Optimization™ to optimize the temperature control of a heat exchanger around a temperature set-point.

Create an estimation experiment from measured data stored in a file and how to preprocess the measured data. You use the imported data to estimate the parameters of a simple RC circuit.

Design a PI control system to control the speed of a DC motor, and is based on the Control System Toolbox™ example "DC Motor Control".

Estimate the physical parameters - mass (m), spring constant (k) and damping (b) of a simple mass-spring-damper model. This example illustrates the significance of initial state

Estimate parameters of a muscle reflex model.

Use Simulink® Design Optimization™ to estimate parameters of a clutch model created using Simscape™ Driveline™ library blocks.

Tune model parameters to meet frequency-domain requirements using the Response Optimization tool.

Estimate the coefficients of a nonlinear (quadratic) function to approximate the dynamic behavior of a system component.

Use parameter bounds to improve estimation performance. This is illustrated by estimating the power rating, P, of a synchronous machine.

Use Simulink® Design Optimization™ to optimize the output response of a plant by tuning the LQR gain matrix and feed-forward gain. This model includes uncertainty in the plant model and

Use experiment data to estimate model parameters. You estimate the parameters of an engine throttle system.

Use Simulink® Design Optimization™ to optimize the multi-loop controller parameters of a distillation column. The Distillation column produces methanol and is represented as a linear

Estimate model parameters from multiple sets of experimental data. You estimate the parameters of a mass-spring-damper system.

Create a 2-D lookup table from experimental data.

Use Simulink® Design Optimization™ to tune an all-pass filter of a Phase Lock Loop. The filter includes a second-order low pass filter and a feedthrough gain. The feedthrough gain and the

Generate a lookup table to approximate an engine volumetric efficiency surface using experimental data.

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a location from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.