Accessing elements in a multilevel structure
显示 更早的评论
I have a struct that contains many other structs. There are several patients. Each patient contains several lesions. And each lesion has various properties. So there are three nested structs. The overall patient struct, the lesion struct, and then the properties struct. For further clarification, here is a quick example. Patient(1) contains Lesion(1), Lesion(2), Lesion(3). Each Lesion has a size, type, etc associated with it.
I would like to know how to access the following information efficiently:
- The sizes of all lesions. Such as: Patients(:).Lesion(:).size
- The sizes of one patients lesions. Such as: Patient(1).Lesion(:).size
- The sizes of all patients lesions of a particular type. Such as: Patients(:).Lesion(if Lesion.type==normal).size
- The sizes of one patients lesion of a particular type. Such as: Patient(1).Lesion(if Lesion.type == normal).size
Thanks in advance.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!