This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Ranges of matrix rows


pr = minmax(P)


pr = minmax(P) takes one argument,


R-by-Q matrix

and returns the R-by-2 matrix PR of minimum and maximum values for each row of P.

Alternatively, P can be an M-by-N cell array of matrices. Each matrix P{i,j} should have Ri rows and Q columns. In this case, minmax returns an M-by-1 cell array where the mth matrix is an Ri-by-2 matrix of the minimum and maximum values of elements for the matrix on the ith row of P.


P = [0 1 2; -1 -2 -0.5]
pr = minmax(P)
P = {[0 1; -1 -2] [2 3 -2; 8 0 2]; [1 -2] [9 7 3]};
pr = minmax(P)

Introduced before R2006a

Was this topic helpful?