Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 367535

Submitted on 10 Dec 2013 by J-G van der Toorn

Correct

23Size
Leading solution size is 10.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = rand(1,38);
y_correct = 1;
assert(isequal(homemade_control_charts(x),y_correct))

                    
2
Pass
 
%%
x = rand(1,50);
x(end) = 5;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))

                    
3
Pass
 
%%
x = rand(1,50);
y_correct = 1;
assert(isequal(homemade_control_charts(x),y_correct))

                    
4
Pass
 
%%
x = rand(1,78);
x(5) = 12;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))

                    
5
Pass
 
%%
x = rand(1,38);
y_correct = 1;
assert(isequal(homemade_control_charts(x),y_correct))

                    
6
Pass
 
%%
x = rand(1,41);
y_correct = 1;
assert(isequal(homemade_control_charts(x),y_correct))

                    
7
Pass
 
%%
x = rand(1,36);
x(end-8) = 9;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))

                    
8
Pass
 
%%
x = rand(1,50);
x(end) = 5;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))

                    
9
Pass
 
%%
x = rand(1,50);
x(end) = -7;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))

                    
10
Pass
 
%%
x = rand(1,50)+9;
x(end) = -70;
y_correct = 0;
assert(isequal(homemade_control_charts(x),y_correct))