Skip to content

strtrimNaN

strings · scripts/strings/strtrimNaN.m

STRTRIMNAN  Remove leading and trailing NaNs (edge trim).

  Y = STRTRIMNAN (X) removes NaN values only from the start and end of
  numeric X, leaving interior NaNs untouched — analogous to STRTRIM for
  whitespace.

  - Vector: drop leading/trailing NaNs.
  - Matrix: drop leading/trailing rows that are all NaN (columns kept).

  Decision (nexus#1974 / mxc-003): MATLAB R2026a has no public
  STRTRIMNAN (toolbox scan empty).  The master-backlog R2021b suite names
  this API; Nexus implements numeric edge-NaN trim.  Non-float input
  errors with MATLAB:strtrimNaN:InvalidInput.

  See also STRTRIM, ISNAN, RMMISSING.