Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Matlab, Simulink and Stateflow
Rating: 4.4 out of 5(893 ratings)
4,672 students

Matlab, Simulink and Stateflow

Model Based Design and Simulation
Last updated 1/2023
English
English [Auto],French [Auto],

What you'll learn

  • 1.1 Basic Matlab syntax
  • 1.2 Operations on data
  • 1.3 Manipulating arrays
  • 1.4 Scripts and functions
  • 1.5 Flow control
  • 1.6 Data visualization
  • 1.6 Dealing with files
  • 2.1 Simulink overview
  • 2.2 Simulink library and basic blocks
  • 2.3 Handling data for Simulink
  • 2.4 Modeling example 1
  • 2.5 Reusability
  • 2.6 Modeling example 2
  • 2.7 Create custom library
  • 2.8 Advanced Visualization
  • 3.1 Stateflow overview
  • 3.2 States; actions and execution
  • 3.3 Types of states
  • 3.4 Transitions and action
  • 3.5 Data in a Stateflow chart
  • 3.6 Flow control
  • 3.7 Functions
  • 3.8 State machine example
  • Debugging and Investigating the code, the model and the statemachine

Course content

3 sections124 lectures14h 15m total length
  • Introducing Matlab1:17

    MATLAB, which stands for Metrics Laboratory, is a programming language and computing environment designed to handle large matrices and teach linear algebra, enabling matrix manipulation, plotting, algorithms, and user interfaces.

  • GUI1:58

    Explore MATLAB's graphical user interface, focusing on four main parts—the ribbon, command window, workspace, and current folder—and learn navigation and basic operations like creating variables and scripts.

  • Creating Variables4:31

    Learn MATLAB variable naming rules and how to create variables in the command window. Understand why using predefined constants and functions can cause conflicts and how to resolve them.

  • Basic Data Types5:53

    Explore MATLAB's numeric data types, including double and single floating point, their ranges, and how to create typed variables with int and unsigned int using conversion functions and class function.

  • Non-Numeric Data Types4:48

    Explore non-numeric data types in Matlab, including logical booleans, structs with nested fields, cell arrays, characters, and tables, with examples of creating, indexing, and inspecting data types.

  • Introduction to Arrays1:54

    Explore how MATLAB treats data as arrays, from scalars to matrices. Create numeric arrays with square brackets and separators to form row vectors, column vectors, and matrices.

  • Generating Arrays and Matrices5:18

    Explore MATLAB functions to generate matrices and arrays, including ones, zeros, rand, linspace, and repmat, and learn reshaping with reshape and creating ranges with the colon operator.

  • Cell Arrays, Table and Character Overview3:56

    Explore MATLAB cell arrays that hold mixed data types in a single container, and learn tables with named rows and columns, ages, heights, weights, blood pressure, and character arrays.

  • Assembling Data2:13

    Combine row and column arrays to form larger matrices in MATLAB, ensuring compatible dimensions, with rows aligning for vertical merges and columns aligning for horizontal merges.

  • Basic Arithmetic Operations3:35

    Explore basic arithmetic operations on arrays and matrices in Matlab, including element-wise operations with .* and ./ and transpose, as well as standard matrix multiplication and dimension rules.

  • Relational Operations4:24

    Explore MATLAB element-wise relational operations that compare corresponding elements across arrays and matrices using operators like greater than, less than, equal to, not equal to, yielding logical true or false.

  • Logical Operations1:55

    Explore logical operations in Matlab by applying gates such as and, or, not, nand, xor, and xnor to data, producing true or false matrices.

  • Indexing16:27

    Explore MATLAB indexing techniques, including suppressing output with semicolons, creating matrices, and single, range, and end-based indexing, plus logical indexing for conditional data extraction.

  • Cell Array Indexing6:42

    Explore cell array indexing in Matlab, using curly braces and parentheses to access values, including nested structs and the differences between vector and cell indexing.

  • Example3:04

    Demonstrates reshaping a 1–100 10×10 matrix, computing the remainder modulo two to classify even/odd, converting to logical, and reconstructing matrices with odd values or zeros.

  • Useful Functions6:49

    Learn MATLAB functions like all, any, sum, prod, min, and max to extract information from arrays and matrices using the column operator for column-wise checks, including values greater than 50.

  • Example 23:37

    Generate a 6x6 matrix of random values between x and y (15 to 61); scale to 0–46, round, shift by x to 15–61, verify with min, max, equals checks.

  • Useful function 25:38

    Explore character arrays in MATLAB, using contains, replace, and count to manipulate text without altering the original, and concatenate with square brackets while sizing with size and length.

  • Complex numbers1:14

    Explore complex numbers in MATLAB, from five plus two i to seven plus 3.8 g, and apply functions like sine, cosine, and exponential; extract real and imaginary parts.

  • Introduction to Scripts6:43

    Create and run MATLAB scripts to automate tasks beyond the command window, using the ribbon and editing area to save and execute commands, including random matrices with min and max.

  • Nested Scripts3:07

    Split a large MATLAB script into smaller scripts, save them with distinct names, and call one script from another to run commands consecutively, using percent signs for documentation.

  • Introduction to User Defined Functions4:57

    Learn how to create user defined functions in MATLAB, pass inputs, return outputs, and reuse code by calling functions within scripts and other functions.

  • Introduction to Workspaces6:08

    Explore how MATLAB uses a base workspace and a separate function workspace, use breakpoints to debug, and generate integer random matrices within a function.

  • Interaction Among Workspaces5:57

    Learn to exchange data between the base workspace and a function with evalin and assignin, display variables across workspaces, and export values to the base workspace.

  • Introducing Flow Control0:28

    Explore how to execute commands based on a condition and how to repeat actions until a condition is fulfilled, guided by flow control in Matlab, Simulink, and Stateflow.

  • If Condition5:07

    Explore how if statements in MATLAB execute commands based on conditions, such as any value in a random matrix being greater than 50, with else and default cases.

  • Switch Statement4:47

    Master flow control with the switch statement, testing a variable for exact values using cases like yes or no, and optionally calling functions or executing scripts within each case.

  • For Loop4:22

    Learn how MATLAB's for loop repeats a code block over an array, displaying messages as k ranges from 1 to 10 or 5 to 13, using k as index.

  • While Loop3:49

    Explore how a while loop controls repetition by a defined condition, updating the loop variable to avoid infinite loops, with examples of different increments and outcomes in MATLAB.

  • Breaking The Loop2:16

    Learn to exit loops with the break statement in Matlab, applying it to for and while loops by using a condition like key equals 21 to break the innermost loop.

  • Example 37:11

    Explore a MATLAB example that uses for and while loops, if statements, and switch inside a loop, processing characters to identify vowels, with sections and run section controls.

  • Introduction to Visualization0:23

    Visualize large data sets by creating 2D or 3D graphs and charts in MATLAB, including line, area, pie, and histogram visualizations.

  • 2D Line Plot26:53

    Learn to create 2d line plots in MATLAB by defining a piecewise function of x, plotting with the plot command, and customizing styles, colors, markers, and axes.

  • 2D Area Plot6:17

    Learn how to build and customize pie charts in MATLAB by counting occurrences of values from 0 to 5, computing percentages, and using the explode option to highlight slices.

  • 3D Linear Plot2:31

    Learn to create 3D plots in MATLAB with plot3 using x, y, z vectors to form 3D line or spiral. Adjust view, range, and point density for rotation and smoothness.

  • 3D Surface Plot8:09

    Learn to create 3d surface plots from matrices using surf and mesh grid, form x and y grids, set z = x*exp(-x^2-y^2), and customize edges and colors; color bar.

  • Dealing With Files0:13

    Explore how MATLAB interfaces with external files, with a focus on Excel workbooks and text files.

  • Interacting With Excel11:35

    Read and write Excel data for MATLAB using table, cell arrays, and structs to extract system data from Excel sheets and create parameter structs.

  • Interacting With Text Files9:17

    Learn how to interface with text files in MATLAB by opening, reading with fscanf, searching with contains, and writing with fprintf, while handling units like degrees Celsius.

  • More About Tables and Arrays6:10

    Build a table with named columns and rows, and index data by row and column names using the current operator. Extend to multidimensional arrays and use size function to inspect.

  • Final Tips and Notes13:38

    Save and load workspace variables in MATLAB with scripts or map files to reuse data. Manage paths with set path and addpath, and locate files using which and whos.

Requirements

  • No programming experience needed however, understanding of what a program or code does is needed
  • Engineering background
  • Basic understanding of some concepts like dynamical systems and simulations

Description

An introductory course for the most powerful tools in scripting, simulating dynamical systems and model based design and designing statemachines.


Matlab which is one of the most widely used scripting language with its capabilities in array manipulation, handling graphics and interacting with files is being explained in a simple and easy way without the need of any programming background.


All basic elements of the language is introduced starting from the basics of the interface up to creating complicated scripts and user defined functions.


Simulink which is the most commonly used tool for simulating dynamical systems and control system design and verification, Also the best tool to depend on when dealing with model based design concepts for control systems, is being discussed step by step starting from the GUI, through knowing the basic blocks and creating complicated models for dynamical systems ending with comparison for many simulations involving control system design example.


Stateflow as the best tool to use to design the simplest and also the most complicated state machines to represent reactive systems like operational modes and handling triggers in a simple graphical representations is being taught starting from a simple example for a statemachine and the more you continue, the more challenging it gets and hence the need for investigation and debugging.

Starting with the basic elements of stateflow like state, transition, action,..., going to having having complicated states, sub-states and parallel states and the tricks of dealing with events specially among parallel states.

Who this course is for:

  • Undergraduates who want to learn about simulations of dynamical systems
  • Post-graduates students who are seeking to prove an engineering concept through simulating real-life dynamical control systems
  • Engineers who are seeking a job in the field of MBD in different industries like Aerospace, Automotive, Medical devices,...
  • People who speak with data and prove with graphs