3

Vectors in Matlab

Chapter Outline

Lesson 3.1 Creating Vectors

Lesson 3.2 Relational and Logical Operations on Vectors

Lesson 3.3 Accessing Elements in Vectors

Lesson 3.4 Arithmetical Operations on Vectors

Lesson 3.5 Plotting Vectors

Answers to Selected Exercises

Lesson 3.1 Creating Vectors

Objective

• To learn how to create vectors in Matlab using four different methods.

Topics

3.1.1 Introduction

3.1.2 Method 1: Creating Vectors Manually

3.1.2.1 Creating Row Vectors Manually

3.1.2.2 Creating Column Vectors Manually

3.1.2.3 Transpose Operation

3.1.2.4 Determining the Number of Elements in a Vector

3.1.2.5 Converting a Vector to a Column Vector

3.1.3 Method 2: Creating Vectors Using the Linear Method

3.1.4 Method 3: Creating Vectors Using ...

Get MATLAB® by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.