Problem 45209. An Ohm's Law Calculator

Solution 2030261

Submitted on 21 Nov 2019 by Athi
  • Size: 11
  • This is the leading solution.
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
I = 0.09; %90mA current R = 100; %100 Ohm resistor V_correct = 9; %9V voltage assert(isequal(OhmsLaw(I,R),V_correct))

2   Pass
I = 0.012; %12mA current R = 1000; %1kOhm resistor V_correct = 12; %12V voltage assert(isequal(OhmsLaw(I,R),V_correct))

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!