matrix manipulation,want to find mean value?

1 次查看(过去 30 天)
having matrix W. its size is 7x50. totally 350 elements. in this column'1' have to find mean value of 4 elements then subtracts this value with remaining mean value of 3 elements. want to get this mean value up to 50 columns.how to implement this?

采纳的回答

nanren888
nanren888 2013-2-23
"subtracts this with" ? .
Try something like
.
homeworkVec = mean(W(1:4,:),1)-mean(W(5:7,1),1);
In mean(x,1), the "1" is default. I just put it in to be explicit.
homeworkVec = mean(W(1:4,:))-mean(W(5:7,1));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by