A blog to help electrical engineers and students to learn electrical engineering topics. Basic Electrical Engineering, Power Systems, Electrical Machines, tec.. Now special course on MATLAB for Beginners.

Class

Class

Wednesday, October 26, 2016

MATLAB Script - Loop Control Part 1



In this lecture we will discuss about another flow control method – Loop control. A loop control is used to execute a set of commands repeatedly The set of commands is called the body of the loop. MATLAB has two loop control techniques  Counted loops - executes commands a specified number of times.  Conditional loops - executes commands as long as a specified expression is true. The counted loops are called ‘for’ loop and the...

Conditional Control in MATLAB Scripts with Examples



In this lecture we discuss more about programming in MATLAB. One main section in programming is flow control. There are many flow control commands in MATLAB. In this lecture we discuss the conditional flow control commands. Conditional statements are commands that allows MATLAB to decide whether or not to execute some code that follows the statement Conditional statements use relational operators like ==,~=,>,< (Note that are all scalar...