Problem 180. Omit columns averages from a matrix
Omit columns averages from a matrix.
For example: A =
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
mean_of_each_column = 8.5000 8.5000 8.5000 8.5000
Result=
7.5000 -6.5000 -5.5000 4.5000
-3.5000 2.5000 1.5000 -0.5000
0.5000 -1.5000 -2.5000 3.5000
-4.5000 5.5000 6.5000 -7.5000
Solution Stats
Problem Comments
-
3 Comments
James White
on 22 Jul 2013
The test suite should include a matrix where the columns have different averages. Also, I think that "subtract" would be easier to understand than "omit".
Georges
on 16 Sep 2014
Totally agree with James!!!
Gabor Bekes
on 29 Jul 2016
Ctrl-C, Ctrl-V from bsxfun's help. Exactly how I like it!
Solution Comments
Show commentsProblem Recent Solvers588
Suggested Problems
-
Remove any row in which a NaN appears
8635 Solvers
-
5763 Solvers
-
2960 Solvers
-
Remove the small words from a list of words.
1521 Solvers
-
Output any real number that is neither positive nor negative
396 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!