# Chapter 2.1 &2.2

 What is an array? *The fundamental unit of data in any Matlab program.*A collection of data values organized into rows and columns. What is a Vector? An array with only one dimension. An array with two or more dimensions is a _______. Matrix How is the size of the array determined? It is specified by the number of rows and the number of columns in the array, (rows, columns). What is a variable? A region of memory containing an array, which is known by a user-specified name. The simplest way to initialize a variable is to assign it one or more values and is written as var = expression; is known as an_______. Assignment Statement All elements of an array are listed in _____ order. Row This expression creates a 1 x 1 array containing the value 3.4 [3.4] This expression creates a 1 x 3 array containing the row vector [1 2 3]. [1.0 2.0 3.0] This expression creates a 3 x 1 array containing the column vector [1 2 3] [1.0; 2.0; 3.0] This expression creates a 2 x 3 array containing the matrix [1 2 3 4 5 6] [1, 2, 3; 4, 5, 6] This expression creates a 2 x 3 array containing the matrix [1 2 3 4 5 6] [1, 2, 34, 5, 6] This expression creates an empty array, which contains no rows and no columns. [ ] Specifies a whole series of values by specifying the first value in the series, the stepping increment, and the last value in the series. Colon Operator The general form of a colon operator is _________. first:incr:last The first value is? The first value in the series. The incr value is? The stepping increment or increasing increment The last value is? The value in that it stops at. Evaluate x = 1:2:10 x=1 3 5 7 9 Generates an n x n matrix of zeroes. zeros(n) Generates an m x n matrix of zeros. zeros(m,n) Generates a matrix of zeros of the same size as arr. zeros(size(arr)) Generates an n x n matrix of ones. ones(n) Generates an m x n matrix of ones. ones(m,n) Generates a matrix of ones of the same size as arr. ones(size(arr)) Generates an n x n identity matrix. eye(n) Generates an m x n identity matrix. eye(m,n) Returns the length of a vector, or the longest dimension of a 2-D array. length(arr) Returns two values specifying the number of rows and columns in arr. size(arr) _________ contains all on-diagonal elements are one, while all off diagnol elements are zero. Identity Matrix AuthorTiaRae ID36279 Card SetChapter 2.1 &2.2 DescriptionChap 2.1&2.2 Matlab Updated2010-09-21T16:44:48Z Show Answers