Illustration of minimum and maximum value, MATLAB in Mathematics

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 first. For illustration, in the data set below, 10 is the maximum value; it is found in three elements in the vector but the index returned is the first element in which it is found (that is 2):

>> x = [9 10 10 9 8 7 3 10 9 8 5 10];

>> [maxval, maxind] = max(x)

maxval =

    10

maxind =

    2

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







Related Discussions:- Illustration of minimum and maximum value, Assignment Help, Ask Question on Illustration of minimum and maximum value, Get Answer, Expert's Help, Illustration of minimum and maximum value Discussions

Write discussion on Illustration of minimum and maximum value
Your posts are moderated
Related Questions
Empty Vectors: An empty vector or in another words, a vector which stores no values, can be generated using the empty square brackets: >> evec = [] evec = [] >> lengt

Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

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

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

Example of Minimum and Maximum Value For matrices, the functions min and max operate column wise by the default: >> mat = randint(2,4,[1 20]) mat =    9   10   1

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

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

Illustration of logical built-in functions: The function find returns the indices of a vector which meet certain criteria. For illustration, to find all the elements in a vect

Built in recursive function in MATLAB: We have seen that the built-in function in MATLAB to compute factorials, termed as the factorial and we know how to implement the iterat

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