Cody

# Problem 43651. create a square matrix

Solution 1686397

Submitted on 4 Dec 2018 by HH
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
n = 3; y_correct =[1 4 9 4 4 9 9 9 9] assert(isequal(mat(n),y_correct))

y_correct = 1 4 9 4 4 9 9 9 9 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In mat (line 2) In ScoringEngineTestPoint1 (line 5) In solutionTest (line 3)]

2   Pass
n = 4; y_correct = [1 4 9 16 4 4 9 16 9 9 9 16 16 16 16 16] assert(isequal(mat(n),y_correct))

y_correct = 1 4 9 16 4 4 9 16 9 9 9 16 16 16 16 16 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In mat (line 2) In ScoringEngineTestPoint2 (line 6) In solutionTest (line 5)]

3   Pass
n= 7; y_correct =[1 4 9 16 25 36 49 4 4 9 16 25 36 49 9 9 9 16 25 36 49 16 16 16 16 25 36 49 25 25 25 25 25 36 49 36 36 36 36 36 36 49 49 49 49 49 49 49 49] assert(isequal(mat(n),y_correct))

y_correct = 1 4 9 16 25 36 49 4 4 9 16 25 36 49 9 9 9 16 25 36 49 16 16 16 16 25 36 49 25 25 25 25 25 36 49 36 36 36 36 36 36 49 49 49 49 49 49 49 49 [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In mat (line 2) In ScoringEngineTestPoint3 (line 9) In solutionTest (line 7)]