View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Explode a structure

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 1.52 KB File ID: #28946 Version: 1.3

Explode a structure



05 Oct 2010 (Updated )

Explode a multi-level structure to find the lowest level field.

| Watch this File

File Information

mystruc = expstruc(bigstructure);

Recursively expands the structure 'bigstructure' until data is found.

Returns a structure 'mystruc', containing two fields
1. 'name'; cell array of strings of the full name of the field
2. 'type' ; cell array of strings of the type of the field (double, logical, whatever)

Intended to be used with 'eval' for structure concatenation (code to follow).

MATLAB release MATLAB 7.6 (R2008a)
Other requirements Tested on Ubuntu with R2008a
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
27 Feb 2012 Itinerant Engineer

updated as of the 26th Feb 2012, version

Comment only
12 Apr 2011 Robert Cumming

Robert Cumming (view profile)

If you change the lines 34 and 37 to be:

mems = expstruc ....

then you dont need the global variable. :)

Comment only
26 Feb 2012 1.3

Removed the need for a global variable, using the method suggested by Robert Cumming.

Contact us