Changing dimensions, MATLAB in Mathematics

Assignment Help:

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


Related Discussions:- Changing dimensions

Using functions with the vectors and matrices, Using Functions with the Vec...

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

Strcat function - concatenation, Strcat function - Concatenation : The ...

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

Three-dimensional pie and bar, Three-dimensional pie and bar: For the ...

Three-dimensional pie and bar: For the bar3 function, x & y vectors are passed and the function displays three-dimensional bars as shown in figure: Figure: Three-dimen

Creating string variables, Creating string Variables: The string consi...

Creating string Variables: The string consists of a few numbers of characters (including, possibly, none). These are the illustrations of the strings: '' 'x' 'ca

Plot functions, Plot Functions: Faraway, we have plotted to generate t...

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

Bar and barh functions - plot functions, bar and barh functions: For a...

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

Histogram - plot functions, Histogram: The histogram is a particular t...

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

Naive Gauss Reduction, Write a MATLAB function [d1, u1, l1, c1, r1] = Naive...

Write a MATLAB function [d1, u1, l1, c1, r1] = NaiveGaussArrow(d, u, l, c, r) that takes as input the 5 vectors de ned above representing A. This function performs Naive Gauss redu

Functions to create special matrices, Functions to create special matrices:...

Functions to create special matrices: The MATLAB also has various functions which create special matrices. For illustration, the zeros function generates a matrix of all zeros

Example of recursive functions, Example of Recursive functions: This d...

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd