Cody

# Problem 2948. Create an m x n array consisting only of an input value.

Solution 2993596

Submitted on 26 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
m = 5; n = 4; x = 5; y_correct = [5 5 5 5; 5 5 5 5; 5 5 5 5; 5 5 5 5; 5 5 5 5] assert(isequal(array_x(m,n,x),y_correct));

y_correct = 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5

2   Pass
m = 4; n = 3; x = -7; y_correct = [-7 -7 -7; -7 -7 -7; -7 -7 -7; -7 -7 -7] assert(isequal(array_x(m,n,x),y_correct));

y_correct = -7 -7 -7 -7 -7 -7 -7 -7 -7 -7 -7 -7

3   Pass
m = 2; n = 6; x = 11; y_correct = [11 11 11 11 11 11; 11 11 11 11 11 11] assert(isequal(array_x(m,n,x),y_correct));

y_correct = 11 11 11 11 11 11 11 11 11 11 11 11

4   Pass
m = 8; n = 1; x = 42; y_correct = [42; 42; 42; 42; 42; 42; 42; 42] assert(isequal(array_x(m,n,x),y_correct));

y_correct = 42 42 42 42 42 42 42 42

### Community Treasure Hunt

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

Start Hunting!