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
Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

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

Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

Error-checking for integers: illustrations of running this script as shown below: >> readoneint Enter an integer: 9.5 Invalid! Enter an integer: 3.6 Invalid

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

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

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

Common form of the switch statement: The common form of the switch statement is as shown below:   switch switch_expression   case caseexp1    action1   case cas

Example of Symbolic Expression When there is more than one variable, the MATLAB selects which to solve for. In the illustration below, the equation ax 2 + bx = 0 is solved. Th

Writing variables to a File: The save command is used to write variables to a file, or to append the variables to a MAT-file. By the default, save function writes to a MAT-fil