Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

enforce_range.m 311 B

1234567
  1. function val = enforce_range(val ,minval, maxval)
  2. % val = enfore_range(val, minval, maxval)
  3. % ensures that the value of x is in between minval and maxval
  4. % val, minval, maxval can be vectors or the same length or some can be scalar
  5. nanidx = isnan(val);
  6. val = min(maxval, max(minval, val));
  7. val(nanidx) = nan;