Cody

Problem 453. resistor ladder

Solution 3370173

Submitted on 25 Oct 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
N=3; R=100; V=12; reading_correct = 6; reading = ladder(N,R,V); assert(abs(reading-reading_correct)<1000*eps)

ans = 400

Output argument "reading" (and maybe others) not assigned during call to "ladder". Error in Test1 (line 3) reading = ladder(N,R,V);

2   Fail
N=3; R=100; V=120; reading_correct = 60; reading = ladder(N,R,V); assert(abs(reading-reading_correct)<1000*eps)

ans = 4000

Output argument "reading" (and maybe others) not assigned during call to "ladder". Error in Test2 (line 3) reading = ladder(N,R,V);

3   Fail
N=5; R=100; V=100; reading_correct = 20; reading = ladder(N,R,V); assert(abs(reading-reading_correct)<1000*eps)

ans = 2000

Output argument "reading" (and maybe others) not assigned during call to "ladder". Error in Test3 (line 3) reading = ladder(N,R,V);

Suggested Problems

More from this Author100

Community Treasure Hunt

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

Start Hunting!