This solution is outdated. To rescore this solution, sign in.
-
1 Comment
Jimmy Sølvsteen Nielsen
on 8 Jun 2020
whereas str2double(dec2bin(x) succeeds, I dont agree it is correct.
str2double(dec2bin(10)) -> 1010
str2double(dec2bin(10)) + 2 -> 1012 ;
this makes little sense in decimal nor in binary code.
I suggest correcting the check to y_correct ='1010'
Suggested Problems
-
Make a run-length companion vector
645 Solvers
-
961 Solvers
-
Number of Even Elements in Fibonacci Sequence
1435 Solvers
-
477 Solvers
-
6487 Solvers
More from this Author70
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!