transpose_structure

transpose_structure(s) transposes all the fields in the structure. useful for later cat(1,s.field)

You are now following this Submission

Users that often use cat(1,s.field) find annoying that this function generates error if the field is in different orientation (row or column vector). Instead of try ... catch, it's suggested to use transpose_structure(s).

>> s = struct('x',ones(10,1),'y',zeros(5,1));
>> s = transpose_structure(s)

Cite As

Alex Liberzon (2026). transpose_structure (https://se.mathworks.com/matlabcentral/fileexchange/40142-transpose_structure), 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.1.0.0

replaced length() by numel()

1.0.0.0