reading multiple .mps files in a loop

2 views (last 30 days)
vishakha nagarajan
vishakha nagarajan on 9 Feb 2022
Commented: Mathieu NOE on 9 Feb 2022
I have about 100 .mps files of raw data and need to process this info(they are all stored in a folder). I want to read each file, extract a specific section of each of the files (from 1:4 coloums), find the maximum value in each of this extracted data (for each file) and store this max data separately. How can I go about this?
Mathieu NOE
Mathieu NOE on 9 Feb 2022
example for excel files below , adapt to your own needs :
fileDir = pwd;
sheet = 2; % data must be retrieved from sheet #2
S = dir(fullfile(fileDir,'*.xlsx')); % get list of data files in directory
S = natsortfiles(S); % sort file names into natural order (what matlab does not) , see FEX :
for k = 1:length(S)
data = xlsread(fullfile(fileDir, S(k).name),sheet); % or use a structure (S(k).data ) to store the full data structure
% your code here

Sign in to comment.

Answers (0)


Find more on Deployable Archive Creation in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by