Cody

Solution 1041343

Submitted on 1 Nov 2016 by Stalin Samuel
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 2 3]; y_correct = 3.7417; assert(abs(vector_mag(x)-y_correct)<0.0001)

d = 1 4 9 y = 1 y = 5 y = 14 y = 3.7417

2   Pass
x = [-1 5 -6]; y_correct = 7.8740; assert(abs(vector_mag(x)-y_correct)<0.0001)

d = 1 25 36 y = 1 y = 26 y = 62 y = 7.8740

3   Pass
x = [3 4 5]; y_correct = 7.0711; assert(abs(vector_mag(x)-y_correct)<0.0001)

d = 9 16 25 y = 9 y = 25 y = 50 y = 7.0711

4   Pass
x = [5 5 -5]; y_correct = 8.6603; assert(abs(vector_mag(x)-y_correct)<0.0001)

d = 25 25 25 y = 25 y = 50 y = 75 y = 8.6603

5   Pass
isempty(regexp(evalc('type vector_mag'),'sum'))

ans = logical 1