Cody

Problem 46612. Find the equivalent resistance of a dc circuit

Solution 2999197

Submitted on 27 Sep 2020 by Benjamin
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:10]; y = 'series'; tol=0.0001 r_correct = 25; assert(abs(equivalent_resistance(x,y)-r_correct)<=tol)

tol = 1.0000e-04

2   Pass
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

Suggested Problems

Community Treasure Hunt

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

Start Hunting!