Cody

Problem 42663. Sum the squares of numbers from 1 to n

Solution 1152463

Submitted on 3 Apr 2017 by H M Dipu Kabir
  • Size: 10
  • This is the leading solution.
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))

ans = []

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

n = 3 s_correct = 14 ans = []

Suggested Problems

Community Treasure Hunt

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

Start Hunting!