Find minimum and maximum for each row, MATLAB in Mathematics

Find Minimum and Maximum for each row

To find the maximum (or minimum) for each row, the dimension of 2 (that is how a MATLAB refers to rows) can be identified as the third argument to the max (or min) function; the second argument should be an empty vector:

>> min(mat,[],2)

ans =

   5

   9

Such functions can also compare vectors or matrices and return the maximum (or minimum) values from corresponding elements. For illustration, the below iterates through all elements in the two vectors, comparing equivalent elements and returning the minimum for each:

>> x = [3 5 8 2 11];

>> y = [2 6 4 5 10];

>> min(x,y)

ans =

2 5 4 2 10

A few of the other functions in the datafun help topic which have been explained already involve cumsum, sum, prod, cumprod, and hist.

Posted Date: 10/22/2012 6:56:35 AM | Location : United States







Related Discussions:- Find minimum and maximum for each row, Assignment Help, Ask Question on Find minimum and maximum for each row, Get Answer, Expert's Help, Find minimum and maximum for each row Discussions

Write discussion on Find minimum and maximum for each row
Your posts are moderated
Related Questions
Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th

Illustration of Advanced file input and output: For illustration, to refer to the third number in the first element of the cell array: >> subjdata{1}(3) ans =

Built-in functions for Complex numbers:   We know that in MATLAB both i and j are built-in functions which return √-1 (therefore, they can be thought of as built-in constants).

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

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

Changing Dimensions: In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, resh

Polar Form: Any complex number z = a + bi can be thought of as a point (a,b) or vector in the complex plane in which the horizontal axis is the real part of z, and the vertica

Find Minimum and Maximum for each row To find the maximum (or minimum) for each row, the dimension of 2 (that is how a MATLAB refers to rows) can be identified as the third arg

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

Use of string variables: The Characters involve letters of the alphabet, punctuation marks, digits, white space, and control characters. The Control characters are characters