Clear Filters
Clear Filters

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

16 views (last 30 days)
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.

Answers (1)

Ameer Hamza
Ameer Hamza on 13 May 2020
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!