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

17 ビュー (過去 30 日間)
Danai Varvatsouli
Danai Varvatsouli 2020 年 5 月 13 日
コメント済み: Ameer Hamza 2020 年 5 月 14 日
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.
  2 件のコメント
Danai Varvatsouli
Danai Varvatsouli 2020 年 5 月 14 日
Work great, Thank you!
Ameer Hamza
Ameer Hamza 2020 年 5 月 14 日
I am glad to be of help.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by