Skip to content
Tutorials Center
My learning

Topics

Simulink Tutorial

Learn Simulink step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Simulink? Block Diagram Modeling Explained Learn what Simulink is, how block diagrams describe dynamic systems, what simulation means and why engineers use model-based design for control, signals and embedded code.
  2. 2 Your First Simulink Model: Interface, Library Browser and Scope Build your first Simulink model step by step: start Simulink, open the Library Browser, place a Sine Wave and Scope, connect the ports and run the simulation.
  3. 3 Simulation Time and Solvers: Fixed-Step vs Variable-Step Understand Simulink simulation time, fixed-step and variable-step solvers, step size, ode45, ode3 and error tolerances, and see how step size changes accuracy.
  4. 4 Logging and Inspecting Simulink Results: To Workspace and Data Inspector Learn how to log Simulink signals with To Workspace, signal logging and Outport blocks, read the sim output object, and compare runs in the Simulation Data Inspector.
  5. 5 Simulink from MATLAB Scripts: sim, set_param and Building Models Control Simulink from MATLAB code: run simulations with sim, change parameters with set_param, read values with get_param and build a model programmatically with add_block and add_line.

Blocks and Models

  1. 6 Simulink Sources, Sinks and Math Blocks: Step, Sum, Gain and More A tour of the most used Simulink blocks: Constant, Step, Ramp, Sine Wave, Pulse Generator, Sum, Gain, Product, Abs, Saturation, Scope, Display and Terminator, with parameters.
  2. 7 Simulink Block Parameters, Workspace Variables and Data Dictionaries Learn how Simulink block parameters use MATLAB expressions, where variables live (base workspace, model workspace, data dictionary), parameter objects and model callbacks.
  3. 8 Simulink Execution Order and Algebraic Loops Explained Understand how Simulink sorts blocks, what direct feedthrough means, why algebraic loops cause errors, and how Unit Delay, Memory or an Integrator break a loop.
  4. 9 Simulink Model Files, Layout and Modeling Style Guidelines Learn Simulink file formats (.slx, .mdl), clean layout, naming, annotations, the Model Advisor, version control and comparing models, plus a small style-checker example.

Signals and Subsystems

  1. 10 Simulink Signals, Dimensions and Data Types: double, int8, boolean, fixed-point Learn signal dimensions (scalar, vector, matrix), data types (double, single, integers, boolean, fixed-point, enumerations), overflow, type conversion and how to display them in a model.
  2. 11 Simulink Signal Routing: Mux, Demux, Switch, Goto/From and Buses Learn the Simulink signal routing blocks: Mux, Demux, Selector, Switch, Multiport Switch, Merge, Goto and From, and how to group signals with Bus Creator and Bus Selector.
  3. 12 Simulink Subsystems: Atomic, Enabled, Triggered and Action Subsystems Learn how to create Simulink subsystems, the difference between virtual and atomic subsystems, and how enabled, triggered, function-call and action subsystems run conditionally.
  4. 13 Simulink Masks, Block Libraries and Model Reference Package reusable Simulink components: create masks with parameters and icons, build and link block libraries, and split large designs into referenced models with the Model block.

Continuous and Discrete Systems

  1. 14 Simulink Integrator Block: Modeling Differential Equations Model differential equations in Simulink with Integrator blocks: initial conditions, the spring-mass-damper example, limits and reset, and how to check the result against RK4 and the exact solution.
  2. 15 Simulink Transfer Function, Zero-Pole and State-Space Blocks Use the Transfer Fcn, Zero-Pole and State-Space blocks for linear systems: coefficient order, poles and stability, DC gain, step response, and conversion between forms.
  3. 16 Simulink Discrete-Time Systems, Sample Times and Rate Transitions Model digital controllers in Simulink: Unit Delay, Discrete-Time Integrator, Discrete Transfer Fcn, sample time settings, color coding, zero-order hold and Rate Transition blocks.
  4. 17 Simulink Zero-Crossings and Hybrid Systems: Bouncing Ball Example Learn how Simulink detects events with zero-crossing detection, which blocks create them, how a bouncing ball hybrid model works, what Zeno behavior is and how to tune related settings.
  5. 18 Simulink Transport Delay, Lookup Tables and Nonlinear Blocks Model real-world nonlinearities in Simulink: Transport Delay, 1-D and 2-D Lookup Tables, Saturation, Dead Zone, Rate Limiter, Relay with hysteresis, Backlash and Quantizer.

Stateflow

  1. 19 Stateflow Charts: States, Transitions and Your First Chart Learn what Stateflow adds to Simulink: add a Chart block, draw states and transitions, add entry and during actions, set the chart's update method and watch it animate.
  2. 20 Stateflow Transitions, Actions, Data, Events and Functions Master Stateflow transition labels: conditions, condition and transition actions, execution order, junctions, local/input/output data, events and chart functions.
  3. 21 Stateflow Hierarchy, Parallel States and History Junctions Structure large Stateflow charts with superstates, exclusive (OR) and parallel (AND) decomposition, execution order, history junctions and super-transitions.
  4. 22 Stateflow Temporal Logic, MATLAB Actions and Truth Tables Use Stateflow temporal logic (after, before, at, every, temporalCount), MATLAB or C actions, state transition tables and truth tables to describe timing and decisions.

Control Design

  1. 23 PID Control in Simulink: Blocks, Tuning and Anti-Windup Build a feedback loop with the Simulink PID Controller block, learn P, I, D and filter terms, tune with the PID Tuner, add anti-windup and discretize the controller.
  2. 24 Simulink Linearization, Operating Points and Frequency Response Find an operating point, linearize a nonlinear Simulink model with linear analysis points, read poles, Bode plots and stability margins, and know what the results mean.
  3. 25 State Feedback, Observers and LQR in Simulink Design state-feedback controllers with pole placement and LQR, add a state observer or Kalman filter, handle reference tracking and build the structure with Simulink blocks.

Code Generation

  1. 26 Simulink Code Generation: Workflow, Simulink Coder and Embedded Coder Generate C code from a Simulink model: prepare the model, set a fixed-step solver and target, build, read the generated files, call the step function and trace code to blocks.
  2. 27 Fixed-Point and Data Types in Simulink: fixdt, Scaling and Overflow Understand Simulink data types and fixed-point design: fixdt, fraction length, ranges, precision, overflow, saturation, rounding and the Fixed-Point Tool workflow.
  3. 28 SIL, PIL and Hardware Deployment for Simulink Models Verify generated code with software-in-the-loop and processor-in-the-loop, compare against simulation, use support packages and real-time targets, and plan a deployment workflow.

Testing and Verification

  1. 29 Simulink Test: Test Harnesses, Test Sequences and the Test Manager Test Simulink components with Simulink Test: create a test harness, write inputs with Test Sequence blocks, add assessments, build baseline and equivalence tests in the Test Manager.
  2. 30 Simulink Coverage: Decision, Condition, MC/DC and Reports Measure how thoroughly tests exercise a Simulink model with Simulink Coverage: decision, condition, MC/DC, lookup table and signal range metrics, reports and closing coverage gaps.
  3. 31 Model Advisor, Modeling Guidelines and Static Checks in Simulink Run the Simulink Model Advisor to find design and standards violations, choose check configurations, fix issues, add custom checks and follow modeling style guidelines for readable models.
  4. 32 Requirements Traceability and Formal Verification in Simulink Link requirements to models and tests with Requirements Toolbox, write formal requirements tables, and use Simulink Design Verifier for property proving, test generation and error detection.

Projects and Practice

  1. 33 Project: Build a Cruise Control Model in Simulink Build a cruise control system in Simulink: vehicle dynamics, PI controller with anti-windup, a Stateflow mode manager, tests and code generation. Includes runnable Python stand-ins.
  2. 34 Project: A Pedestrian Crossing Traffic Light in Stateflow Design a traffic light with a pedestrian button in Stateflow: states, temporal logic, a parallel request memory, safety checks, tests and code generation, with runnable stand-ins.
  3. 35 Project: DC Motor Position Control from Model to Code Model a DC motor, linearize it, design cascaded PID and LQR position controllers, add friction and saturation, test against requirements and prepare fixed-point code. Python stand-ins included.
  4. 36 Practice: Simulink Troubleshooting, Debugging and Design Review Practice fixing common Simulink problems: algebraic loops, solver and step-size trouble, sample time errors, unexpected Stateflow behavior, slow models, plus a review checklist and exercises.