access data in a nested struct
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a struct with several levels. For example:
s.L1.L2.L3
what would be the most efficient way to look for a string in Level L3?
Thanks!
댓글 수: 0
채택된 답변
SC
2020년 6월 30일
편집: SC
2020년 6월 30일
Let us name your string field inside L3 as 'Name'.
If you want to access data inside a nested struct,
You can do it by, s.L1.L2.L3.Name = 'String'
For more information on accessing nested structs refer to the following: https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-nested-structures.html
댓글 수: 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!