Determining organization of a struct - possibly an unknown one

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by