Cody

Problem 46716. Matrix with increasing numbers (★★★★)

Solution 3158491

Submitted on 11 Oct 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   Pass
m = 3; n = 4; Z_correct = [1 2 3 4; 5 6 7 8; 9 10 11 12]; assert(isequal(your_fcn_name(m,n),Z_correct))

2   Pass
m = 2; n = 5; Z_correct = [1 2 3 4 5; 6 7 8 9 10]; assert(isequal(your_fcn_name(m,n),Z_correct))

3   Pass
m = 1; n = 8; Z_correct = [1 2 3 4 5 6 7 8]; assert(isequal(your_fcn_name(m,n),Z_correct))

4   Pass
m = 5; n = 1; Z_correct = [1 2 3 4 5]'; assert(isequal(your_fcn_name(m,n),Z_correct))

5   Fail
filetext = fileread('your_fcn_name.m'); assert(isempty(strfind(filetext, 'for')),'for forbidden') assert(isempty(strfind(filetext, 'while')),'while forbidden') assert(isempty(strfind(filetext, 'reshape')),'reshape forbidden')

reshape forbidden

Suggested Problems

More from this Author46

Community Treasure Hunt

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

Start Hunting!