Converts a structure into a double matrix.
[out]=struct2double(in) creates out(A,B,C) where [A,B]=size(in) and
fn=fieldnames(in) C=length(fn)
fields must be doubles and not structures
[out]=struct2double(in,field) creates out(A,B,C) where [A,B]=size(in) and
for the given fieldname 'field'.
Cite As
Clayton (2024). struct2double (https://www.mathworks.com/matlabcentral/fileexchange/42981-struct2double), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
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.
Version | Published | Release Notes | |
---|---|---|---|
1.3.0.0 | It should do the overall structure into a matrix better. If the fields are not the same dimensions than nans will be used to fill. Currently only handles a MxN for the structure and a 3D matrix for each field, but this can easily be adjusted. |
||
1.2.0.0 | added a squeeze function at the end to bring it to the smallest dimensions. |
||
1.1.0.0 | edited indexes for the chosen fieldname |
||
1.0.0.0 |