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

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

The basic syntax is


žIf the conditional expression is true, MATLAB runs the lines of code that are between the line with if and the line with end.
If the conditional expression is false, MATLAB skips the code between if and the line with else and runs the code up to end.



submit to reddit

1 comments:

  1. My partner and i enjoyed babushka your represents. That is magnificent a big long-winded for me. My partner and i impulsive saved that in the same way My business is hunting compliment in order to style exceptional understands. Range in the magnificent cipher. plumbing services in Kuwait

    ReplyDelete