transpose_structure
Version 1.1.0.0 (1.32 KB) by
Alex Liberzon
transpose_structure(s) transposes all the fields in the structure. useful for later cat(1,s.field)
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 LinuxCategories
Find more on Structures in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.