Code covered by the BSD License  

Highlights from
Explode a structure

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

Explode a structure

by

 

05 Oct 2010 (Updated )

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

| Watch this File

File Information
Description

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

12 Apr 2011 Robert

If you change the lines 34 and 37 to be:

mems = expstruc ....

then you dont need the global variable. :)

Updates
26 Feb 2012

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

Contact us