Omit columns averages from a matrix.
For example: A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1mean_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
Solution Comments
Show comments
Loading...
Problem Recent Solvers618
Suggested Problems
-
Remove all the words that end with "ain"
2633 Solvers
-
2537 Solvers
-
Calculate the area of a triangle between three points
3412 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13592 Solvers
-
293 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!
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".
Totally agree with James!!!
Ctrl-C, Ctrl-V from bsxfun's help. Exactly how I like it!