Determining organization of a struct - possibly an unknown one

1 Ansicht (letzte 30 Tage)
Ravi
Ravi am 27 Sep. 2012
Is there a way to get the data types of a structure without manually or programmatically going through each element (and potentially recursively)?
1) Simple case: >> files = dir('*.*'); >> files
27x1 struct array with fields: name date bytes isdir datenum
>> class(files(1).name) ans = char
I can check each field individually but think there ought to be some way of getting the data type side-by-side. I've tried who, whos, fieldnames, and such without success
2) Less simple cases: Since big structs can have little structs within them, I'm trying to figure out how to determine the overall organization of a complicated "as-received"structure. I am currently doing it by looking in the workspace editor and making notes but this has its limits

Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by