Collapse

COLLAPSE - Reduces a scalar field within an arrayed structure to a single output vector

You are now following this Submission

VECT = COLLAPSE(STRUC, FIELDNAME) returns array of the scalar data contained in STRUC.FIELDNAME. Any empty entries in STRUC return NaN

VECT = COLLAPSE(STRUC, FIELDNAME, MISSING) Empty entries in STRUC return MISSING instead of NaN

Example:
struc(1).Data = 3;
struc(2).Data = 4;
vect = collapse(struc, 'Data');

Cite As

James Brooks (2026). Collapse (https://www.mathworks.com/matlabcentral/fileexchange/32780-collapse), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0