Given a non-empty vector x with integer elements. x shall be called balance vector if one can split the elements of x into two groups which are in total equal. e.g.
x=[1,1] balance vector because 1=1
x=[1,7] non-balance vector because 1~=7
x=[2,3,5] balance vector because 2+3=5
Write a function that returns true or false depending if the given vector is a balance vector or not!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers32
Suggested Problems
-
Remove any row in which a NaN appears
8771 Solvers
-
How to find the position of an element in a vector without using the find function
2814 Solvers
-
Find the maximum number of decimal places in a set of numbers
3382 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
884 Solvers
-
135 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
See Problem 74. Balanced number in the same spirit.