Cody

Solution 1234562

Submitted on 19 Jul 2017 by Chris Cleveland
  • Size: 9
  • 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
x = [3 -2 -4]; y_correct = [ 1.5352 -0.8685]; assert(abs(sum(your_fcn_name(x)-y_correct))<0.001)

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

2   Pass
x = [1 2 1]; y_correct = [-1;-1]; assert(abs(sum(your_fcn_name(x)-y_correct))<0.001)

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

3   Pass
x = [1 2 2]; y_correct = [ -1.0000 + 1.0000i -1.0000 - 1.0000i]; assert(abs(sum(your_fcn_name(x)-y_correct))<0.001)

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]

Suggested Problems

More from this Author27