O'Reilly logo

Programming in MATLAB ® by Ram N. Patel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9

Efficient Coding Using Vectorization Technique

After studying this chapter, you should be able to:

  • Learn vectorization technique
  • Convert loops into vectorized codes
  • Learn techniques for faster computations
  • Design efficient codes using vectorization technique

9.1 Introduction

MATLAB® is commonly used in several engineering and scientific disciplines where large scale numerical calculations are involved. Sometimes programs may take days to execute. Therefore, it is important to learn how to write such programs efficiently so that they can run in hours or even minutes. MATLAB programs are interpreted, that is, each statement is executed at the command prompt independently of others, and there is no separate binary image generated as in compiled ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required