Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 184075

Submitted on 1 Jan 2013 by Richard Zapor

Correct

48Size
Leading solution size is 17.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
N=3; R=100; V=12;
reading_correct = 6;
reading = ladder(N,R,V);
assert(abs(reading-reading_correct)<1000*eps)

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

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

                    
4
Pass
 
%%