Matlab basic functions of information and interpretation

In Matlab full name matrix & laboraty Matrix Laboratory

length: length of the array, i.e. the greater the number of rows or number of columns. n = Length (A): if A is non-empty array, return the number of rows between the two columns and a larger value that the value is equivalent to the implementation of the max (size (A)); if A is an empty array, return 0; if a is a vector, the length a is returned. n = max (size (A)); if the non-matrix A, the maximum number of vitamin A, if the maximum number of zero-dimensional matrix A is empty, return non-A.

size: Gets the number of rows and columns of the array, view the dimension of a vector.

:( colon) Usage:
. 1, (x1: d: pitch sequence x2) This method is used to generate the like, between x1 and x2 arithmetic sequence to generate a pitch d, multiple x1 and x2 if the difference is not in the d then the generated sequence does not comprise x2, d omitted when the default spacing d 1.
2, a (:,. 3) in a matrix vector represented by a full line is taken or an entire column. No description lines, with a colon in place, regardless of how many rows, all rows involved in computing, columns empathy.
3, A (a1: b1, a2: b2) is taken this form, represented by matrix A line a2 to a1, a2 and b2 column element of the matrix.
x (:,:, meaning :) x (i, j, k ) refers to the i-th row of the k-th layer j-th column matrix, x (:,:, 1 ) denotes the first matrix layer.
x (1, :) y = x (1, :), the first row of the matrix x to all the columns are assigned to y. On behalf of all colon.
x (:,:) = [ ], a (:, 1: 3) = [] indicates the first column to the third column of the array a. Colon represents a first array of all the rows, 1: 3 represents the first to third column of the array a take.
abs function usage: abs (x) is a function of the magnitude to the absolute value, and absolute values of the complex values. For complex x = a + b * i, there abs (x) = sqrt (a2 + b2).

Guess you like

Origin blog.csdn.net/dan_youshang/article/details/94738842