Cody

Solution 2371688

Submitted on 25 May 2020
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   Fail
x = [0 1 -1 0]; ac_correct = [0 1 -1 0]; dc_correct = 0; [ac dc] = acDC(x); assert(isequal(ac,ac_correct)) assert(isequal(dc,dc_correct))

Index in position 1 exceeds array bounds (must not exceed 1). Error in acDC (line 4) dc = x(a,a); Error in Test1 (line 4) [ac dc] = acDC(x);

2   Fail
x = [5 6 4 5]; ac_correct = [0 1 -1 0]; dc_correct = 5; [ac dc] = acDC(x); assert(isequal(ac,ac_correct)) assert(isequal(dc,dc_correct))

Index in position 1 exceeds array bounds (must not exceed 1). Error in acDC (line 4) dc = x(a,a); Error in Test2 (line 4) [ac dc] = acDC(x);

Suggested Problems

More from this Author43