Test  Status  Code Input and Output 

1  Fail 
s = '1001';
y_correct = '0110';
assert(all(isequal(flipbit(s),y_correct)&ischar(flipbit(s))))
a =
1
a =
1 0
a =
1 0 0
a =
1 0 0 1
y =
1×4 logical array
0 1 1 0
y1 =
'0 1 1 0'
a =
1
a =
1 0
a =
1 0 0
a =
1 0 0 1
y =
1×4 logical array
0 1 1 0
y1 =
'0 1 1 0'

2  Fail 
s = '11';
y_correct = '00';
assert(all(isequal(flipbit(s),y_correct)&ischar(flipbit(s))))
a =
1
a =
1 1
y =
1×2 logical array
0 0
y1 =
'0 0'
a =
1
a =
1 1
y =
1×2 logical array
0 0
y1 =
'0 0'

3  Fail 
s = '1';
y_correct = '0';
assert(all(isequal(flipbit(s),y_correct)&ischar(flipbit(s))))
a =
1
y =
logical
0
y1 =
'0'
a =
1
y =
logical
0
y1 =
'0'

4  Fail 
s = '100000001';
y_correct = '011111110';
assert(all(isequal(flipbit(s),y_correct)&ischar(flipbit(s))))
a =
1
a =
1 0
a =
1 0 0
a =
1 0 0 0
a =
1 0 0 0 0
a =
1 0 0 0 0 0
a =
1 0 0 0 0 0 0
a =
1 0 0 0 0 0 0 0
a =
1 0 0 0 0 0 0 0 1
y =
1×9 logical array
0 1 1 1 1 1 1 1 0
y1 =
'0 1 1 1 1 1 1 1 0'
a =
1
a =
1 0
a =
1 0 0
a =
1 0 0 0
a =
1 0 0 0 0
a =
1 0 0 0 0 0
a =
1 0 0 0 0 0 0
a =
1 0 0 0 0 0 0 0
a =
1 0 0 0 0 0 0 0 1
y =
1×9 logical array
0 1 1 1 1 1 1 1 0
y1 =
'0 1 1 1 1 1 1 1 0'

5  Fail 
s = '00001';
y_correct = '11110';
assert(all(isequal(flipbit(s),y_correct)&ischar(flipbit(s))))
a =
0
a =
0 0
a =
0 0 0
a =
0 0 0 0
a =
0 0 0 0 1
y =
1×5 logical array
1 1 1 1 0
y1 =
'1 1 1 1 0'
a =
0
a =
0 0
a =
0 0 0
a =
0 0 0 0
a =
0 0 0 0 1
y =
1×5 logical array
1 1 1 1 0
y1 =
'1 1 1 1 0'

Make the vector [1 2 3 4 5 6 7 8 9 10]
44058 Solvers
Convert a vector into a number
560 Solvers
Given a matrix, return the last eigen value
162 Solvers
409 Solvers
343 Solvers