How to calculate the average columns values for a table in matlab ?

조회 수: 1 (최근 30일)
ahmed obaid
ahmed obaid 2017년 3월 31일
댓글: ahmed obaid 2017년 3월 31일
Dear Experiences
i have a data table include numeric values .. i need to calculate the average values of table columns and then eliminate columns their average less than certain values (such as 0.002) , then write new table to new excel file. i will thanks any one can give a help on this duty ..
attached my portion of data table (when its imported to matlab using read table function)

채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 3월 31일
편집: Andrei Bobrov 2017년 3월 31일
EDIT
x = readtable('test.xls');
k = .002;
t = varfun(@isnumeric, x,'OutputFormat','uniform');
x1 = x(:,t);
out = [x(:,~t), x1(:,varfun(@mean, x1,'OutputFormat','uniform') > k)];

추가 답변 (0개)

카테고리

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