transpose_structure

transpose_structure(s) transposes all the fields in the structure. useful for later cat(1,s.field)
229 Downloads
Updated 5 Feb 2013

View License

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 (2024). transpose_structure (https://www.mathworks.com/matlabcentral/fileexchange/40142-transpose_structure), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Structures in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

replaced length() by numel()

1.0.0.0