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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!