Cody

Problem 43006. Odd row

Solution 2989192

Submitted on 25 Sep 2020 by Benjamin
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   Pass
r = 15; m = 4; function y = OddRow(r,m) y_correct = [1 5 9 13]; assert(isequal(OddRow(x),y_correct)) end

2   Pass
r = 21; m = 6; function y = OddRow(r,m) y_correct = [1 7 13 19]; assert(isequal(OddRow(x),y_correct)) end

3   Pass
r = 31; m = 8; function y = OddRow(r,m) y_correct = [1 9 17 25]; assert(isequal(OddRow(x),y_correct)) end

4   Pass
r = 27; m = 4; function y = OddRow(r,m) y_correct = [1 5 9 13 17 21 25]; assert(isequal(OddRow(x),y_correct)) end

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!