>  Docs Center  >  Libraries  >  Motley  >  MGH_RESOLVE_INDICES
Libraries

MGH_RESOLVE_INDICES

MGH_RESOLVE_INDICES

Name


  MGH_RESOLVE_INDICES

Purpose


  This procedure generates a series of indices for referencing a
  vector.
  I found myself writing this code over and over in my
  model-analysis code so I put it in a separate procedure. The idea
  is that we have a vector of known size and we want to specify a
  subset of its elements. We can specify this subset using range and
  stride parameters or my listing the indices. A negative value for
  any of these parameters indicates a position relative to the end
  of the vector

Calling Sequence


  MGH_RESOLVE_INDIcES, num, range, stride, indices

Positional Parameters


  num (input, compulsory, integer, scalar)
    Number of elements in vector.
  range (input, optional, integer, 2-element vector)
    Minimum and maximum indices. Default is first and last.
  stride (input, optional, integer, scalar)
    Spacing of indices. Default is 1.
  indices (input & output, integer, vector)
    List of indices.
###########################################################################
  This software is provided subject to the following conditions:
  1. NIWA makes no representations or warranties regarding the
    accuracy of the software, the use to which the software may
    be put or the results to be obtained from the use of the
    software. Accordingly NIWA accepts no liability for any loss
    or damage (whether direct of indirect) incurred by any person
    through the use of or reliance on the software.
  2. NIWA is to be acknowledged as the original author of the
    software where the software is used or presented in any form.
###########################################################################

Modification History


  Mark Hadfield, 2002-02:
    Written.



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us