MATLAB Examples

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

Open diagnosticsSolverSettigns.mdl

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

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

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 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.

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:

See all countries