Cody

Problem 1726. Ohm's Law

Solution 2331238

Submitted on 22 May 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
V = 6; R = 3; I = []; out = 2; assert(isequal(OhmsLaw(V,I,R),out))

Unrecognized function or variable 'IR'. Error in OhmsLaw (line 2) V = IR; Error in Test1 (line 5) assert(isequal(OhmsLaw(V,I,R),out))

2   Fail
V = []; R = 3; I = 4; out = 12; assert(isequal(OhmsLaw(V,I,R),out))

Unrecognized function or variable 'IR'. Error in OhmsLaw (line 2) V = IR; Error in Test2 (line 5) assert(isequal(OhmsLaw(V,I,R),out))

3   Fail
V = 22; R = 100; I = []; out = 0.2200; assert(isequal(OhmsLaw(V,I,R),out))

Unrecognized function or variable 'IR'. Error in OhmsLaw (line 2) V = IR; Error in Test3 (line 5) assert(isequal(OhmsLaw(V,I,R),out))

4   Fail
V = 120; R = 1.5; I = []; out = 80; assert(isequal(OhmsLaw(V,I,R),out))

Unrecognized function or variable 'IR'. Error in OhmsLaw (line 2) V = IR; Error in Test4 (line 5) assert(isequal(OhmsLaw(V,I,R),out))

5   Fail
V = 100000; R = []; I = 0.0005; out = 200000000; assert(isequal(OhmsLaw(V,I,R),out))

Unrecognized function or variable 'IR'. Error in OhmsLaw (line 2) V = IR; Error in Test5 (line 5) assert(isequal(OhmsLaw(V,I,R),out))

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!