How Normalize each column to itself mean value

2 ビュー (過去 30 日間)
Rachele Franceschini
Rachele Franceschini 2022 年 4 月 12 日
I have one table with in y the regions, while in x several years (2010, 2011, 2012, 2013 etc). Each year has one value for each region. I would like to nomalize the data of each column. Here, there is file excel. it is possible to normalize using the mean of the year? I tried this, but I am not sure.
t=readtable('Cartel3.xlsx')
t_norm a= normalize((t{2:end, 2:end}),'norm')
This is my table

採用された回答

Enrico Gambini
Enrico Gambini 2022 年 4 月 13 日
Hi, you can try this:
T=readtable('Cartel3.xlsx');
n_years=10; %In your file you've got 10 years, you can obvioysly change it if needed
Tnorm=T; %Initialize the table with normalized values
for i=2:(n_years+1) %starts from the second row, because in the first a character is present
Tnorm{:,i}=T{:,i}/mean(T{:,i});
end
% Then, if you want to export the new table
writetable(Tnorm,'Tnorm.xlsx')
  1 件のコメント
Rachele Franceschini
Rachele Franceschini 2022 年 4 月 13 日
thank you for you help!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by