File Exchange

image thumbnail

Explode a structure

version 1.3 (1.52 KB) by

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

2 Downloads

Updated

View License

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).

Comments and Ratings (2)

updated as of the 26th Feb 2012, version

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. :)

Updates

1.3

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

MATLAB Release
MATLAB 7.6 (R2008a)

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

» Watch video