Dimensions - matrix, MATLAB in Mathematics

Dimensions - matrix:

The size and length functions in the MATLAB are used to find array dimensions. Length function returns the number of elements in the vector. The size function returns the number of rows & columns in a matrix. For matrix, the length function will return either the number of rows or the number of columns, whichever is the maximum. For illustration, the following vector, vec, has 4 elements therefore its length is 4. It is a row vector; hence, the size is 1 × 4.

>> vec = -2:1

vec =

-2  -1  0  1

>> length(vec)

ans =

4

>> size(vec)

ans =

1  4

Posted Date: 10/18/2012 4:28:42 AM | Location : United States







Related Discussions:- Dimensions - matrix, Assignment Help, Ask Question on Dimensions - matrix, Get Answer, Expert's Help, Dimensions - matrix Discussions

Write discussion on Dimensions - matrix
Your posts are moderated
Related Questions
Complex numbers: A complex number is commonly written in the form z = a + bi here a is known as the real part of the number z, b be the imaginary part of z, and i is √-1

Illustration of logical built-in functions: The function find returns the indices of a vector which meet certain criteria. For illustration, to find all the elements in a vect

Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

Blanks function: The blanks function will generate a string consisting of n blank characters-that are kind of hard to see here! Though, in a MATLAB if the mouse is moved to hi

Illustration of Variance For illustration, for the vector [4, 6, 1, 5], there are n = 4 values therefore n - 1 is 3. The mean of this data set is also 4. The variance will be

Example of Symbolic Expression When there is more than one variable, the MATLAB selects which to solve for. In the illustration below, the equation ax 2 + bx = 0 is solved. Th

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Plot types: Besides plot and bar, there are another plot types like stem plots, histograms, stem plots, area plots and pie charts, and also other functions which customize the

Using Functions with the Vectors and Matrices: As MATLAB is written to work with the vectors and matrices, the whole vector or matrix can be passed as an argument to the funct

Illustration of Labels and prompts: The program below prompts the user for endpoints (x1, y1) and (x2, y2) of a line segment, and computes the midpoint of the line segment, th