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 291237

Submitted on 28 Jul 2013 by @bmtran

Correct

36Size
Leading solution size is 20.
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
 
%%
V = 6;
R = 3;
I = [];
out = 2;
assert(isequal(OhmsLaw(V,I,R),out))

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

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

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

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