*------------- Telecommunications & Signal Processing Lab --------------
*                          McGill University
*
*
* Module:
*     SUBROUTINE MINMAX (X, N, XMIN, XMAX)
*
*
* Purpose:
*     Find the minimum and maximum values in an array
*
*
* Description:
*     This routine determines the minimum and maximum valued elements
*     in an array.
*
*
* Parameters:
* R ->  X      -  Input array
* I ->  N      -  Number of elements of X
* R <-  XMIN   -  Minimum value
* R <-  XMAX   -  Maximum value
*
*
* Author / revision:
*     P. Kabal
*     $Revision: 1.5 $  $Date: 1995/03/08 15:04:47 $
*
*
*-----------------------------------------------------------------------

      SUBROUTINE MINMAX (X, N, XMIN, XMAX)


      INTEGER N
      INTEGER I

      REAL XMIN,XMAX
      REAL X(N)


      XMAX=X(1)
      XMIN=X(1)

      DO 100 I=2,N
        IF (X(I).GT.XMAX) THEN
          XMAX=X(I)
        ELSE IF (X(I).LT.XMIN) THEN
          XMIN=X(I)
        END IF
 100  CONTINUE


      RETURN

      END
