Detect maximum value of multiple Excel-Files

조회 수: 1 (최근 30일)
Talha Demirel
Talha Demirel 2019년 8월 6일
답변: Bob Thompson 2019년 8월 6일
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.

답변 (1개)

Bob Thompson
Bob Thompson 2019년 8월 6일
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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by