MATLAB Answers

Access sub folders in *.mat file (struct)

1 view (last 30 days)
Jeroen Vermeulen
Jeroen Vermeulen on 13 May 2020
Commented: Walter Roberson on 13 May 2020
Dear Mathworks forum,
Since it's been a while that I've worked with loading *.mat files, I was struggling to open sub folders in a *.mat file that I received for a project.
I'm quite a novice in this topic, so I'd like to ask your help. I added 4 pictures in the attachments to sketch my situation.
The *.mat struct file is named ''BODY'', where I'd like to access a sub folder BODY.SEGMENT(1).Cluster.MarkerInputFileIndices, as seen in the respective 4 pictures.
Which commands could I run to load the MarkerInputFileIndices into a vector in this case? I expected this to be easy, but couldn't come to a solution yet. Please let me know!
Greetings,
Jerome

  1 Comment

Walter Roberson
Walter Roberson on 13 May 2020
.mat files do not have "subfolders". You are looking at structures and structure fields.
YourVector = BODY.SEGMENT(1).Cluster.MarkerInputFileIndices;

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!