Load only specific substructures from a mega-structure.

Hello,
So I have many .mat files each one consisting of one structure (data) that contains another structure (files) which contains multiple other structures (segment01,segment02 and so on).
Let's say I want to access only a specific segment, eg. segment01. I have to load the .mat file and then do something like segment01=data.files.segment01.
This takes a lot of time. I know that if I had my .mat in the form data.Segment01, data.Segment02 etc I would easily load only a speciifc substructure but I do not know how to access only data.files.Segment01. Is there any way?
Thanks

댓글 수: 4

The question is not clear. Please explain more
Maybe you are looking for dir, fieldnames and getfield
I have some .mat files. subject01.mat,subject02.mat etc. Each file contains multiple segments that are in nested structure so to access segment01 of subject01 I should do the following:
load('Subject01.mat')
segment01 = data.files.Segment01.
The 1st step takes a lot of time because it has to load all the substructures (data.files.Segment01,data.files.Segment02 etc.) I want to speed up step 1 by loading only data.files.Segment01
You can't load only part of data
I see... Thanks for letting me know

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

제품

태그

질문:

2020년 6월 12일

댓글:

2020년 6월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by