Cody

# Problem 46612. Find the equivalent resistance of a dc circuit

Solution 2988202

Submitted on 24 Sep 2020 at 18:51
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 = [1:2:10]; y = 'series'; tol=0.0001 r_correct = 25; assert(abs(equivalent_resistance(x,y)-r_correct)<=tol)

tol = 1.0000e-04

Error using assert The condition input argument must be convertible to a scalar logical. Error in Test1 (line 5) assert(abs(equivalent_resistance(x,y)-r_correct)<=tol)

2   Fail
x = [10:-1:1]; y = 'parallel'; tol=0.0001 r_correct = 0.3414; assert(abs(equivalent_resistance(x,y)-r_correct)<=tol)

tol = 1.0000e-04

Error using assert The condition input argument must be convertible to a scalar logical. Error in Test2 (line 5) assert(abs(equivalent_resistance(x,y)-r_correct)<=tol)

### Community Treasure Hunt

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

Start Hunting!