Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 2^5;
y_correct = true;
assert( isequal(on_bit_boundary(x),y_correct) )
x = 2^5 - 5;
y_correct = false;
assert( isequal(on_bit_boundary(x),y_correct) )
x = 127
y_correct = true;
assert( isequal(on_bit_boundary(x),y_correct) )
x = 1023
assert( isequal(on_bit_boundary(x),y_correct) )
y_correct = false;
x = 501
assert( isequal(on_bit_boundary(x),y_correct) )
v = 2*(rand(1,10) > 0.5)-1;
for i =2:10
assert( on_bit_boundary( 2^i + v(i)) == (v(i) < 0 ) )
end
x =
127
x =
1023
x =
501
|
2261 Solvers
3974 Solvers
329 Solvers
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
140 Solvers
531 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!