© Sandeep Nagar 2017

Sandeep Nagar, Introduction to MATLAB for Engineers and Scientists, https://doi.org/10.1007/978-1-4842-3189-0_5

5. Functions and Loops

Sandeep Nagar

(1)New York, USA

5.1 Introduction

When a particular numerical tasks needs to be “repeated” over different data points, digital computers become a useful tool since they can do this with greater speed than humans. Loops perform exactly these tasks. Using a condition to check the start and termination rules, you can perform repetitive parts of a process easily. Different programming languages and environments have different rules for defining loops. MATLAB provides a much simpler way to define and run loops. They will be discussed shortly.

It’s useful to define the term function here. ...

Get Introduction to MATLAB for Engineers and Scientists: Solutions for Numerical Computation and Modeling now with the O’Reilly learning platform.

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