Assignment #2 (Keywords)
Assignment #2 (Keywords)
• Eye(m, n): it returns an m by n matrix with 1's on the diagonal and 0's elsewhere.
• Transpose(X): it returns the nonconjugate transpose of X, that is, interchanges the row and column
index for each element.
• Linspace: it generates linearly spaced vectors. It is similar to the colon operator ":", but gives direct
control over the number of points.
• Det(X): it returns the determinant of the square matrix X. If X contains only integer entries, the result
is also an integer.
• Rank: it provides an estimate of the number of linearly independent rows or columns of a full matrix.
• Sin(X): it returns the sine of the elements of X. The sin function operates element-wise on arrays. The
function accepts both real and complex inputs.
• Sind(X): it returns the sine of the elements in X, which are expressed in degrees.
• Min(A): it returns the smallest elements along different dimensions of an array. If A is a vector, min(A)
returns the smallest element in A. If A is a matrix, min(A) treats the columns of A as vectors, returning a
row vector containing the minimum element from each column.
• Max(A): it returns the maximum elements of an array. If A is a vector, then max(A) returns the maximum
of A. If A is a matrix, then max(A) is a row vector containing the maximum value of each column.
• Log10(X): it returns the common logarithm of each element in array X. The function accepts both real
and complex inputs.
• Exp(X): it returns the exponential for each element of X. For complex elements, it returns the complex
exponential.
• Find(X): it returns the indices of the array X that point to nonzero elements. If none is found, find returns
an empty matrix.
• Clc: it clears all the text from the Command Window, resulting in a clear screen.
• Clear: it removes all variables from the workspace and frees up system memory.
• Factorial(n): it returns the product of all positive integers less than or equal to n, where n is a
nonnegative integer value.
• Rem(x,y): it returns the remainder after division of x by y, where x is the dividend and y is the divisor.
• Round(X): it rounds each element of X to the nearest integer. In the case of a tie, where an element
has a fractional part of exactly 0.5, the round function rounds away from zero to the integer with larger
magnitude.
• Sort(X): it sorts the elements along different dimensions of an array, and arranges those elements in
ascending order.
• Floor(X): it rounds the elements of A to the nearest integers less than or equal to X. For complex values
of X, the imaginary and real parts are rounded independently.
• Ceil(X): it rounds the elements of A to the nearest integers greater than or equal to X. For complex X,
the imaginary and real parts are rounded independently.
• Plot(X,Y): it creates a 2-D line plot of the data in Y versus the corresponding values in X.
• Length(X): it returns the length of the largest array dimension in X. For vectors, the length is simply the
number of elements.
• Size(X): it returns a row vector whose elements contain the length of the corresponding dimension
of X.