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에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!