Cody

Problem 2610. counting for loop

Solution 2360838

Submitted on 24 May 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
global gRV; gRV = []; N = 10; gRV_correct = [3 5 7 9]; counting_loop(N); code = textread('counting_loop.m', '%s'); assert(isequal(gRV, gRV_correct) && strcmp(code(5), 'for'));

Error using counting_loop (line 2) Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering. Error in Test1 (line 5) counting_loop(N);

2   Fail
global gRV; gRV = []; N = 5; gRV_correct = [3 5]; counting_loop(N); code = textread('counting_loop.m', '%s'); assert(isequal(gRV, gRV_correct) && strcmp(code(5), 'for'));

Error using counting_loop (line 2) Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering. Error in Test2 (line 5) counting_loop(N);

3   Fail
global gRV; gRV = []; N = 3; gRV_correct = [3]; counting_loop(N); code = textread('counting_loop.m', '%s'); assert(isequal(gRV, gRV_correct) && strcmp(code(5), 'for'));

Error using counting_loop (line 2) Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering. Error in Test3 (line 5) counting_loop(N);

4   Fail
global gRV; gRV = []; N = 0; gRV_correct = []; counting_loop(N); code = textread('counting_loop.m', '%s'); assert(isequal(gRV, gRV_correct) && strcmp(code(5), 'for'));

Error using counting_loop (line 2) Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering. Error in Test4 (line 5) counting_loop(N);

5   Fail
global gRV; gRV = []; N = 39; gRV_correct = [3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39]; counting_loop(N); code = textread('counting_loop.m', '%s'); assert(isequal(gRV, gRV_correct) && strcmp(code(5), 'for'));

Error using counting_loop (line 2) Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering. Error in Test5 (line 5) counting_loop(N);