How can I find multiple means from an excel sheet using only one line of code?

1 view (last 30 days)
In an excel file with multiple columns of data, how can you find the mean of each column using only one line of code instead of individually finding all the means?
data = xlsread('Caregivers.xlsx');
%mean mean_age= mean (data (:,2)); mean_income = mean(data (:,3)); mean_duration = mean(data (:,4)); mean_health = mean(data (:,5)); mean_ADL = mean(data (:,6));

Answers (1)

Image Analyst
Image Analyst on 13 Feb 2015
How about
columnMeans = mean(data);
??? Also, please read this

Community Treasure Hunt

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

Start Hunting!