access an array from a field inside a structure?

조회 수: 2 (최근 30일)
Hamda Altamimi
Hamda Altamimi 2019년 2월 20일
댓글: Bob Thompson 2019년 2월 20일
how to access an array in a field in a structure?
university.student.grades
the grades is a field that has an array that i want to access
  댓글 수: 2
Stephen23
Stephen23 2019년 2월 20일
What size is the structure university ?
What size is the structure student ?
Bob Thompson
Bob Thompson 2019년 2월 20일
Stephen's questions are very relevent, as accessing specific information within a structure often requires indexing. Luckily this indexing is fairly similar to indexing within a normal numeric array.
In order to access a specific student's grades, at a specific university, you need to index the structure to find these specific elements.
Ex: bob = university(1,7).student(249,3).grades

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by