Vectors - Basic Information and Creating a Vector by Toshant

# Vectors - Basic Information and Creating a Vector by...

This preview shows pages 1–2. Sign up to view the full content.

Vectors I. What is a vector? a. Vectors are a collection of values. More specifically, vectors are values that are put together in a line. Whether that line is vertical or horizontal, that is up to the vector. b. Vectors are helpful in manipulating large values of data. We can do everything from pick out the 5th value to pick out the values that are only multiples of 11. c. Vectors are homogeneous . c.i. This primarily means that vectors can only hold one type of value. Meaning, they can only hold doubles (aka numbers), logicals, strings, etc. d. Vectors are manipulated using their positions. d.i. vec = [58 27 123 20 70] d.ii. In vector "vec", value 58 sits in position 1, 27 sits in position 2, and so on. II. Ways to create a vector a. Direct Entry - Placing values directly between square brackets. a.i. vec = [68 23 12 57 68] a.ii. The above line of code will create a vector named "vec" with the values written above. b.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/28/2012 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Tech.

### Page1 / 2

Vectors - Basic Information and Creating a Vector by...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online