Not sure why this solution gets marked as incorrect. I haven't been able to stump it. Can you find something wrong?
function [tf] = pattern_recognition1(array)
L = length(array);
one=array(1:3:L); two=array(2:3:L); three=array(3:3:L);
check = ((length(one) + length(two) = length(three)) /length(one);
c1 = all(one == one(1)); c2 = all(two == two(1)); c3 = all(three == three(1));
if c1 ==1 && c2 == 1 && c3 == 1
if check == 3;
tf = 1;
else tf = 0;
end
else tf = 0;
end
Line 5, replace 2nd "=" with "==".
Test  Status  Code Input and Output 

1  Fail 
array = [1 2 3 1 2 3 1 2 3];
tf = 1;
assert(isequal(pattern_recognition1(array),tf))

2  Fail 
array = [1 2 2 1 2 2];
tf = 1;
assert(isequal(pattern_recognition1(array),tf))

3  Fail 
array = [1 10 100 1 10 100 1 10 100 1 10 100];
tf = 1;
assert(isequal(pattern_recognition1(array),tf))

4  Fail 
array = 'abcabcadcabcabc';
tf = 0;
assert(isequal(pattern_recognition1(array),tf))

5  Fail 
array = [1 2 3 1 2 3 2 2 3];
tf = 0;
assert(isequal(pattern_recognition1(array),tf))

6  Fail 
array = 'hi hi hi ';
tf = 1;
assert(isequal(pattern_recognition1(array),tf))

7  Fail 
array = [1 2 2 1 2 1];
tf = 0;
assert(isequal(pattern_recognition1(array),tf))

8  Fail 
array = 'abcabcabcabcabc';
tf = 1;
assert(isequal(pattern_recognition1(array),tf))

9  Fail 
array = 'hi ho hi ';
tf = 0;
assert(isequal(pattern_recognition1(array),tf))

10  Fail 
array = [1 10 100 1 10 100 1 10 10 1 10 100];
tf = 0;
assert(isequal(pattern_recognition1(array),tf))

11  Fail 
ind = randi(4);
switch ind
case 1
array = 'abcabcabcabcabc';
tf = 1;
case 2
array = [1 10 100 1 10 100 1 10 10 1 10 100];
tf = 0;
case 3
array = [1 2 2 1 2 2];
tf = 1;
case 4
array = 'hi ho hi ';
tf = 0;
end
assert(isequal(pattern_recognition1(array),tf))

12  Fail 
ind = randi(4);
switch ind
case 1
array = [1 2 3 1 2 3 2 2 3];
tf = 0;
case 2
array = [1 10 100 1 10 100 1 10 100 1 10 100];
tf = 1;
case 3
array = [1 2 3 1 2 3 2 2 3];
tf = 0;
case 4
array = [1 2 2 1 2 2];
tf = 1;
end
assert(isequal(pattern_recognition1(array),tf))

235 Solvers
436 Solvers
1143 Solvers
107 Solvers
141 Solvers