how do I subtract and then mean in every row of a data set?
Show older comments
Say I had a 10000x10 matrix, and in every row. I wanted to take the conditional mean for columns 1-5 and 6-10, get the difference of these two means, and then make that appear in a new data set in the corresponding row. Would I use for loop? I am new to mat lab so I'm not sure how to use it Thank you
4 Comments
per isakson
on 22 Apr 2015
"conditional mean for columns 1-5"   I'm not sure I understand what that is.
Image Analyst
on 22 Apr 2015
What do you mean by "data set", and if you mean just regular numbers, then where in the 10,000 by 10 matrix do you want the difference of the two means to appear? In column 11? In column 10,001?
Clifford Wu
on 23 Apr 2015
Edited: Clifford Wu
on 23 Apr 2015
Clifford Wu
on 23 Apr 2015
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!