Input x is a decimal number and output y is the complement of binary representation of x.
For example, x = 10 has the binary representation of 00001010 (Assume, 8-bit binary representation).
[0 0 0 0 1 0 1 0]
And the output is
y = [1 1 1 1 0 1 0 1]
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers47
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53526 Solvers
-
2252 Solvers
-
Generate a random matrix A of (1,-1)
432 Solvers
-
The sum of the numbers in the vector
647 Solvers
-
Matlab Basics II - Create a vector with a repeated entry
254 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!
Your problem needs to define the complement of a binary number. There is more than one way to do it with negative numbers.