Find minimum and maximum for each row, MATLAB in Mathematics

Assignment Help:

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.


Related Discussions:- Find minimum and maximum for each row

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

Structure consisting of the fields, Structure Consisting of the Fields ...

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

Writing to files, Writing to Files: There are many lower level functio...

Writing to Files: There are many lower level functions which can write to files. We will focus on the fprintf function that can be used to write a file and also to append to a

Fprintf function - file function, fprintf function - File function: Th...

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

Applications of customized strings, Applications of Customized Strings: Lab...

Applications of Customized Strings: Labels, Prompts, Arguments to Functions: The one of very useful application of this is to involve numbers in strings that are used to plot

Writing and reading spreadsheet files, Writing and Reading Spreadsheet File...

Writing and Reading Spreadsheet Files: The MATLAB functions xlswrite & xlsread will write to and read from the spreadsheet files which have the extension .xls. For illustratio

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

Illustration of writing to files, Illustration of Writing to files: He...

Illustration of Writing to files: Here is the other illustration in which a matrix is written to a file. At First, an arbitrary 2 × 4 matrix is generated, and then it is writt

Referring to and modifying the matrix elements, Referring to and Modifying ...

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

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