简体   繁体   中英

how to calculate the mean in matlab

I have captured data using a Shimmer for three different types of fall. A trip, weak and strong fall. I have broken these into sub plots and now I need to calculate the mean. I am new to Matlab and don't understand how to calculate the mean of each of the below:

subplot(3,1,1), plot(weak(:,2:4));
subplot(3,1,2), plot(Trip(800:1600,2:4));
subplot(3,1,3), plot(Strong(:,2:4));

Do i just need to do something like:

 subplot(3,1,1), plot mean(weak(:,2:4));

I am totally lost here, please help.

Thanks.

Since mean of a 2d matrix takes the mean of each column you could use

M = mean(weak)
plot(M(:,2:4))

Or if you prefer just

plot(mean(weak)(:,2:4))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM