Ohm’s Law states that resistance R can be calculated as:R=V/I
where:
- V is the voltage (in volts)
- I is the current (in amperes)
- R is the resistance (in ohms)
Write a function to compute resistance given voltage and current.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers519
Suggested Problems
-
Ohm’s Law - Calculate Resistance
519 Solvers
More from this Author20
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
This formula is incorrect. It calculates power rather than resistancee.
@William no, the formula is correct*
Resistance = Voltage / Current
The general formula for electrical power is:
Power = Voltage * Current
(at least in DC, more complicated in AC)
* as of 2025-05-17. Apologies if the problem was corrected since your comment.
The test suite is far too small, nowhere near comprehensive enough.
At the moment, any solution that returns 0 will pass.
Need to add more tests, such as V = 10, I = 11.
I recently finished this problem. Future people, remember that you're solving for the RESISTANCE. Don't overthink it.