Battery Life Estimation for a Device - MATLAB Cody - MATLAB Central

Problem 60798. Battery Life Estimation for a Device

Difficulty:Rate
A battery-powered device consumes a constant current while operating. The estimated battery life (T) can be calculated using the formula:
where:
  • Q is the battery capacity (in ampere-hours, Ah)
  • I is the device's current consumption (in amperes, A)
  • T is the estimated battery life (in hours)
Write a function to estimate how long a battery will last given its capacity and the device’s current consumption.

Solution Stats

73.33% Correct | 26.67% Incorrect
Last Solution submitted on Mar 14, 2025

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers21

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page