Home > utility > maxxy.m

maxxy

PURPOSE ^

maxxy: Maximum of a matrix

SYNOPSIS ^

function [maxValue, maxIndex] = maxXy(mat)

DESCRIPTION ^

maxxy: Maximum of a matrix
    Usage: [maxValue, maxIndex] = maxxy(A)
        maxValue: the maximum of the matrix A
        maxIndex: the 2D index of maxValue in A

    For example:
        [maxValue, maxIndex]=maxXy(magic(5))

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [maxValue, maxIndex] = maxXy(mat)
0002 %maxxy: Maximum of a matrix
0003 %    Usage: [maxValue, maxIndex] = maxxy(A)
0004 %        maxValue: the maximum of the matrix A
0005 %        maxIndex: the 2D index of maxValue in A
0006 %
0007 %    For example:
0008 %        [maxValue, maxIndex]=maxXy(magic(5))
0009 
0010 %    Roger Jang, 20010219, 20071009
0011 
0012 [colMax, colMaxIndex] = max(mat);
0013 [maxValue, tmp] = max(colMax);
0014 maxIndex = [colMaxIndex(tmp) tmp];

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003