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
Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

Illustration of a recursive function: illustration is of a recursive function which does not return anything, but simply prints. The below function prtwords receives a sentenc

Strings as Vectors: The Strings are considered as vectors of characters-or in another words, a vector in which each and every element is a single character-so numerous vector

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

Matrix of Plots: The other function which is very useful with any type of plot is subplot that creates a matrix of plots in the present Figure Window. The three arguments are

Example of Logical built-in functions: For equivalent to all the function, we should make sure that the entire elements in the vector are logically true. The one way of doing

Illustration of Spreadsheet Files: This reads the numbers in a double vector variable nums and the text in a cell array txt (the xlsread function forever returns the numbers f

Differentiation: The derivative of a function y = f(x) can be written as follows or f  '(x) and is defined as the rate of change of the dependent variable y with respe

how can reconstruct just part of an image using imreconstruct?

Example of Recursive functions: This definition is recursive as a factorial is defined in terms of the other factorial. There are two parts to any recursive definition: the co