How to calculate the max and min values of 3 specific columns on an excel file?

16 次查看(过去 30 天)
I have an excel file with a table 1442x31, and I want to calculate max, and min only from 3 columns (5,14,23).
Column 5 is Total population
Column 14 is Men population
Column 23 is Women population
And I want to find min and max of each of these columns.

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-5-13
Something like this
data = xlsread('filename'); % load data from excel file
cols = data(:, [5 14 23]); % extract the required columns
min_val = min(cols);
max_val = max(cols); % these commands will ouyput minimum and maximum of each column.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by