struct2double

Version 1.3.0.0 (1.32 KB) by Clayton
Converts a structure into a double format.
386 Downloads
Updated 11 Sep 2013

View License

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
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Data Type Conversion in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
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