MATLAB for Engineers - Introduction to for Loops (Part 4 of 4): Combining Loops and Logic

Spartan Professor
Spartan Professor
26.3 هزار بار بازدید - 4 سال پیش - A for loop is a
A for loop is a loop structure for repeating a calculation a pre-defined number of times. In this video, we will combine loops and logic by nesting the conditional statements if, elseif, and else inside of a for loop to generate a plot. First, I'll introduce you to the problem. Then, we'll walk through a flow chart to demonstrate how the conditional statements dictate the path that the program takes. Finally, we'll solve the problem in the MATLAB programming environment.

If you are unfamiliar with for loops and how they can be used to perform scalar operations, I'd recommend watching Parts 1 and 2 of the series. If you are unfamiliar with working with arrays or array indexing inside of a for loop then I would recommend checking out Part 3. Links to Parts 1 through 3 can be found below.

Part 1 introduces the basic structure of a for loop and demonstrates a loop pass. Link to Part 1: MATLAB for Engineers - Introduction t...

Part 2 focuses on updating the value of a scalar variable during each loop pass. Link to Part 2: MATLAB for Engineers - Introduction t...

Part 3 introduces working with arrays and array indexing inside of a for loop. Link to Part 3: MATLAB for Engineers - Introduction t...

The background music in the intro and outro was written and produced by Michael J Calamas for the exclusive use of David Calamas.
4 سال پیش در تاریخ 1399/09/03 منتشر شده است.
26,305 بـار بازدید شده
... بیشتر