Cody

Problem 42865. Find the sum of n squares

Solution 3126327

Submitted on 9 Oct 2020 by Pink_panther
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
x = 1; y_correct = 1; assert(isequal(your_fcn_name(x),y_correct)) x = 15; y_correct = 1240; assert(isequal(your_fcn_name(x),y_correct)) x = 50; y_correct = 42925; assert(isequal(your_fcn_name(x),y_correct))

y = 1 y = 1 y = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 y = 1240 y = Columns 1 through 29 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Columns 30 through 50 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 y = 42925

Suggested Problems

Community Treasure Hunt

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

Start Hunting!