Changing dimensions, MATLAB in Mathematics

Changing Dimensions:

In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, reshape, flipud, and rot90.

The function reshape changes the dimensions of a matrix. The matrix variable below mat is 3   4, or in another words it has 12 elements.

>> mat = randint(3,4,[1 100])

mat =

14 61  2 94

21 28 75 47

20 20 45 42

These 12 values rather than it could be arranged as a 2   6 matrix, 6   2, 4   3, 1 12, & 12   1. The function reshape iterates throughout the matrix column wise. For illustration, whenever reshaping mat into a 2   6 matrix, the value from the first column in the original matrix (14, 21, and 20) are used first, then the values from the second column (61, 28, 20), and so on.

>> reshape(mat,2,6)

ans =

14 20 28  2 45 47

21 61 20 75 94 42

Posted Date: 10/18/2012 4:30:35 AM | Location : United States

Related Discussions:- Changing dimensions, Assignment Help, Ask Question on Changing dimensions, Get Answer, Expert's Help, Changing dimensions Discussions

Write discussion on Changing dimensions
Your posts are moderated
Related Questions
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

Standard Deviation The standard deviation is the square root of variance: The built-in function in a MATLAB for the standard deviation is known as std; the standard dev

Histogram: The histogram is a particular type of bar chart which shows the frequency of occurrence of the values within a vector. The Histograms use what are known as bins to

How do I write a product series running from i to n of x''s using a for loop?

Built-in function for Differentiation: The MATLAB has a built-in function, diff that returns the differences between consecutive elements in a vector. For illustration, >>

fprintf function - File function: The fprintf function really returns the number of bytes which was written to the file, therefore if you do not want to see that number, suppr

Refer the subset of a matrix: It is also possible to refer to the subset of a matrix. For illustration, this refers to the first & second rows, second & third columns: >> m

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

Labels and Prompts: The script loads all the numbers from file into a row vector. It then splits the vector; it stores the initial element that is the experiment number in a v

Illustration of Standard Deviation The less spread out the numbers are, therefore smaller the standard deviation will be, as it is a way of determining the spread of the data.