Cody

Solution 2013173

Submitted on 11 Nov 2019
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 = 1; s_correct = 1; assert(isequal(sumOfSquares(n),s_correct))

x = 1 s = 1

2   Fail
n=3 s_correct=14 assert(isequal(sumOfSquares(n),s_correct))

n = 3 s_correct = 14

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in sumOfSquares (line 2) x = [1:n]^2 Error in Test2 (line 3) assert(isequal(sumOfSquares(n),s_correct))