Control Structures, Loops, and File Handling

After studying this chapter, you should be able to:

  • use conditional statements in programs
  • learn various loops, nested loops, and conditional breaking of control structures
  • learn file handling in MATLAB®

4.1 Introduction

Logical decision-making and loops are two very important components in writing a computer program. It is important to properly learn the syntax of conditional and loop structures. In this chapter, conditional statements and loops in MATLAB are discussed.

Frequently, a user has to load data that is available in external files, perform certain computations on it, and store the results in output files. Such file handling exercises form an important part of MATLAB programming since ...

Get Programming in MATLAB ® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.