MATLAB Answers

0

Detect maximum value of multiple Excel-Files

Asked by Talha Demirel on 6 Aug 2019
Latest activity Answered by Bob Nbob
on 6 Aug 2019
Hi,
is it possible to scan e.g. 100 excel files and detetct the maximum values of each?
in one file there are many distance values registered, so the goal is to extract the maximum distance per file.
--> file_1,max: 3 cm
file_2,max: 5 cm
file_3,max: 7 cm
.
.
.
file_100,max: 4 cm
And then I want to create a diagram out of these maximum datas which is not a big issue. The main task is to generate the maximum values of the files.
Thanks.

  0 Comments

Sign in to comment.

1 Answer

Answer by Bob Nbob
on 6 Aug 2019

The cleanest way that I can think of doing this is to just loop things. You may need to change the range you are looking to find the maximum value in, but the basic concept should be the same as this:
files = dir('*.xlsx'); % Assumes you are working in the folder with the excel documents, and they are all in one folder already
for i = 1:length(files)
data = xlsread(files(i).name,range); % If no range is specified, will read the entire first sheet
maxes(i) = max(data); % Maximum value in entire dataset
end

  0 Comments

Sign in to comment.