MATLAB Answers

Load certain index .mat file

23 views (last 30 days)
Tsuwei Tan
Tsuwei Tan on 31 Jul 2018
Commented: Tsuwei Tan on 31 Jul 2018
Please find the attached pic.
I have 164,934 .mat files at the folder
Is there a way to load one .mat by knowing only the index?
For instance, I would like to load number 600th .mat out of 164,934 without knowing the file name.
Thank you!

  0 Comments

Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 31 Jul 2018
files=dir('*.mat');
load(files(600).name);

  1 Comment

Tsuwei Tan
Tsuwei Tan on 31 Jul 2018
Thank you! Simple and very explicit!

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!