
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.
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.
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.
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.
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.
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.
Explore logical operations in Matlab by applying gates such as and, or, not, nand, xor, and xnor to data, producing true or false matrices.
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.
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.
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.
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.
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.
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.
Learn how to create user defined functions in MATLAB, pass inputs, return outputs, and reuse code by calling functions within scripts and other functions.
Explore how MATLAB uses a base workspace and a separate function workspace, use breakpoints to debug, and generate integer random matrices within a function.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Explore how MATLAB interfaces with external files, with a focus on Excel workbooks and text files.
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.
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.
Explore Simulink, a MATLAB based graphical programming environment for modeling, simulating, and analyzing multi-domain dynamical systems. Assemble graphical blocks to build interdomain simulations, opened from MATLAB via the Simulink button.
Explore the Simulink graphical user interface, including the ribbon and the simulation area, where you add blocks to build and run systems. Inject inputs and monitor outputs to execute simulations.
Builds a simple sine wave model in Simulink, connects to a scope, runs the simulation, and adjusts amplitude, offset, frequency, and phase.
Convert a differential system to a discrete difference equation using sampling time dt, mapping x dot and x double dot to x(n-1), x(n-2), and implement with Simulink blocks.
Define parameters in the MATLAB workspace and let Simulink assign them to blocks, avoiding hardcoded values and enabling easy model updates while comparing discrete and continuous simulations at sample times.
the lecture presents the discrete transfer function as the final representation, comparing it with the difference equation and the z-transform form, showing their numerical similarity under sampling, using four methods.
Explore the continuous sub library, including derivative and various integrator blocks (simple, second order, limited), and configure PID and transfer function blocks with tuning options.
Explore discontinuities in Simulink blocks using saturation with fixed and dynamic limits, observe input bounding, dead zones producing zero output, and limiters adapting to changing signals.
Explore bitwise operations in Simulink, applying and, or, and bitwise operators to each array element across ports. Use unit delay and a constant block to compare values and detect changes.
Explore how lookup tables compute outputs from inputs using x-axis breakpoints and y-axis table data; choose dimensions, input ranges, interpolation, extrapolation, and search strategies, including dynamic lookup table variants.
Explore basic math operations in Matlab, Simulink and Stateflow, including absolute, addition, gain, product, inverse, square root, and subtraction. Learn about negative of a signal, approximation, and ports and subsystem.
Explore how to set and convert data types in Simulink and MATLAB, using external and internal methods, including data type conversion blocks, saturation, and inheritance rules.
Learn to create and use Simulink and MATLAB functions, including function prototypes, input/output arguments, data types, and examples like y = f(u) and a sine wave.
Explore destination blocks in Simulink, including scope, display, to workspace, to file, and x c graph, and learn to save simulation data as time series.
Explore the sources sub library in Simulink, where signal clock, counters, pulse generator, ramp, step, and signal builder generate, visualize, and configure signals without inputs.
Explore how virtual and atomic subsystems influence execution order in a mass-spring-damper model, showing that virtual subsystems permit flexible ordering while atomic subsystems execute as a single block.
Explore flow control in Simulink with enabled subsystems that execute when the enable port is true, and compare hold versus reset behavior and initial values.
Trigger the triggered subsystem on rising or falling edges with a trigger block, using the signal builder to define the edge and execute the sample when triggered.
Practice if condition flow control by routing inputs through action subsystems using expressions, a measure block to select the active path, and a signal builder for tests.
Understand the enable the triggered subsystem in Matlab, where an enable and a trigger signal control execution, with edge types and options for initial values and outputs.
Demonstrate resettable flow control in a Simulink subsystem by resetting an integrator to three on rising edges and on falling edges, using a sine input and a signal builder.
Function call subsystems execute based on a function code triggered periodically, such as every 3 seconds, or by conditional criteria, similar to a trigger subsystem.
Use the model explorer to view open models and their model workspace, update base workspace parameters, attach data to models, run simulations, and explore blocks, subsystems, and variant control components.
Explore how reusability in simulink enables using a subsystem or model across projects through model references and libraries, with linked blocks, parameter injection, and propagation of changes.
Parameterize a custom PID library in Simulink by masking a subsystem, exposing KP, KI, KD and a cut-off frequency through a dialog and edit boxes.
Model a DC motor as an electromechanical system with electrical and mechanical parts linked by back emf and torque, simulated in Simulink to study voltage-driven speed.
Demonstrates configuring a motor control model with an external input voltage and a constant torque, includes model reference and speed output omega, and applies pid control.
Master Simulink debugging by stepping forward and back through a sine wave multiplied by two, using run, pause, stop, and conditional breakpoints, with a display block and adjustable step size.
Explore the signal table and property inspector to view and edit block parameters, signals, and states, and trace signals to sources and destinations with go to and from.
Explore Stateflow, a controlled logic toolbox from MathWorks that uses state machines and flowcharts to model active systems, with transitions, conditions, actions, default actions, and looping logic, linking to Simulink.
Explore the basic elements of state flow, including states, transitions, a default starting point, actions, junctions, and the data driving transitions and a flow graph.
Design a Stateflow-based state machine for an air conditioning system, with on/off transitions driven by input U, output Y, and entry, during, and exit actions, plus basic simulation.
Demonstrate a state machine that transitions between off and on using entry and during actions, with y reflecting state. Configure a counter, limit, and 0.05s sample time to control transitions.
Explore how Stateflow handles more complex transitions using conditional and temporal logic, including multiple transitions with priorities, before/after timing, and during actions, to create on/off pulse behavior.
Stateflow language uses MATLAB syntax for actions, with MATLAB or C options; simulate to view a diagnostic window and use semicolons to set the limit to 16 or 32.
Explore substate design inside a super state in Stateflow, modeling an air conditioner with on/off as the parent and cold, hot, dry, and wet as substates with transitions.
Explore using a history junction inside a super state to preserve the last active substate when exiting and re-entering a state in Matlab Stateflow.
Introduce variables u, v, w, and x in a Stateflow chart, add dummy states, and compare external and internal self-transitions and history junction effects.
Learn how parallel states enable multiple active states in Stateflow, contrast with exclusive execution, and organize complex behavior with sub charts and readable layouts using a heat and fan example.
Explore advanced Stateflow actions, including exit actions, temporal actions on, after, and before transitions, and condition actions, and learn to coordinate parallel states with local variables and transition actions.
Describe how a flow graph in Stateflow models condition-based paths with junctions and transitions, using x, z, and data to determine actions across every sample.
explore stateflow transitions with junctions and multiple segments, including condition and transition actions, and learn best practices like placing the transition action at the last segment.
Explore graphical patterns in flow graphs, using if and else, for and while loops, and switch case structures to model control logic in Matlab, Simulink, and Stateflow.
Detect input changes to trigger state transitions using has changed to or has changed from, ensuring smooth on/off transitions in matlab, simulink, and stateflow.
Broadcast events per parallel state to keep scope local, use fan to route, and apply dot mutation to broadcast across parallel states, ensuring actions trigger correctly.
Introduce truth tables with inputs and outputs, organized as a condition table and an action table, to determine the maximum of four inputs through comparisons, decisions, and don't care cases.
Explore three Stateflow function types—graphical, signaling, and MATLAB—showing how to define and use them like in Simulink, with local and chart variables, inputs, and outputs.
Learn to embed simulink blocks in stateflow charts, create atomic and parallel simulink states, manage inputs, outputs, and interfaces, and handle local variables and transitions for parallel execution.
Analyze the execution flow of actions, condition checks for transitions, and event handling in a machine with two parallel states and nested sub-states, covering internal and external transitions.
At time zero, state one and state two activate in parallel with default states; entry actions run for state one and state three, while others have none.
We repeat the initial part of the sub case and mark two false. Then three is true, routing to a path where nothing executes, with the rest unchanged.
Explore case 3 in a stateflow model, tracing active states and transitions driven by conditions seven, c three, c two, with e1, e2, e3, e4 broadcasts and during entry actions.
Demonstrates a stateflow case from the second circuit case, showing exit and entry actions and during actions across parallel states, with a broadcast event e5 and potential infinite loops.
Trace how stateflow case 4 navigates states 111, 112, and 212, evaluates conditions ten and eleven, executes E2 and E3 during actions, and handles a junction default.
Case 5 demonstrates stateflow style transitions, evaluating conditions C14, C12, C13 and events E3, E9, E1 to drive state changes and during actions, highlighting careful event handling.
Analyze a Stateflow case where condition checks and events drive transitions, execute exit and entry actions, and broadcast events across states.
Case 8 of Matlab, Simulink and Stateflow demonstrates a sequence of state transitions driven by event e3, with broadcasts, condition checks, and corresponding entry and exit actions.
Explore how to design robust state machines in Matlab, Simulink, and Stateflow by analyzing conditions, events, and transitions, including entry and exit actions, to avoid infinite loops and runtime errors.
Log signals and local variables in the state machine using the data inspector to monitor on/off transitions during simulation, enabling flexible logging in Simulink or Stateflow.
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.