Express integers in negabinary - MATLAB Cody - MATLAB Central

Problem 60781. Express integers in negabinary

Difficulty:Rate
Negabinary numbers are written in base -2. For example, the negabinary number 11010 is (-2)^4+(-2)^3+(-2)^1 = 16 - 8 – 2, or 6 in base 10. In a similar way, -3 in base 10 is 1101 in negabinary.
Write a function that converts an integer to negabinary, written as a character string.

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jan 08, 2025

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
18
6

Problem Recent Solvers5

Suggested Problems

More from this Author291

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page