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
bar and barh functions: For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown: rm = randint(2,4,[1

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Types of User-defined Functions: We know how to write a user-defined function, stored in an M-file, which computes and returns one value. This is merely one type of the functi

Illustrations of Variable number of output arguments: In the illustrations shown here, the user should actually know the type of the argument in order to establish how many va

Nested IF-ELSE statements: The if-else statement is used to select between the two statements. In order to select from more than two statements, the if-else statements can als

Animation: In this part we will observe a couple of ways to animate a plot. These are visuals, therefore the outcomes can't really be shown here; it is essential to type these

Print an imaginary number: To print an imaginary number, the function disp will show both parts automatically: >> disp(z1)    4.0000 + 2.0000i The function fprint

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

Illustration of Writing to files: Here is the other illustration in which a matrix is written to a file. At First, an arbitrary 2 × 4 matrix is generated, and then it is writt

Plot Functions: Faraway, we have plotted to generate two-dimensional plots and bar to generate bar charts. We have seen how to clear the Figure Window by using clf, and how to