MATLAB Lesson 3 - Vectors

Estimated time required:

30 minutes

Recap

In Lesson 2 you learnt what are valid variable names in MATLAB, how to store a value in a variable, how to display the value of a variable or suppress output to the screen and how to list all the variables in your workspace.

 

Vectors

One of the great powers of mathematics and MATLAB is the ability to work with vectors (and matrices, but that will come in a later lesson) with any number of elements (2, 3, 4 or millions). For example, the vector could describe the temperature at different points in an object, the concentration of a chemical at different times or the values of different stocks.

Objectives

The aim of this module is to understand how to create and manipulate vectors in MATLAB.

What you should know by the end of this module:

Instructions

Work your way through the pages of this lesson using the links in the blue bar above or at the bottom of each page. You should do them in order initially but you can return to any of them when you need to refresh your memory. You can print the pages by using the printable copy icon in the Resources menu bar to the right.

Hint: Have both these lessons open in a web browser and MATLAB open in another window so you can try all the examples as you work through the lessons.

It is recommended that you attempt the self-test exercises that you will find on each page. There is a quiz at the end of the module for which you will receive a grade.  You final mark for this quiz will be the highest mark you achieve before the due date for the quiz.

For further information on the topics covered in this module, read section 2.4 of the Introduction to MATLAB notes.