A new dynamic model is developed in this paper based on the generic MATLAB battery model. The battery capacity is expressed as a function of the self-discharge rate, the discharge current, the cycling life and the temperature of the battery. The dependence of the model parameters on cycle life and temperature are estimated from the first order approximation. The detailed procedures and formula to extract the model parameters are presented and the extraction relies only on the discharge curves at two different discharge currents, at two different life cycles, and at two different temperatures. These discharge curves are typically provided in the battery manufacturer's datasheet. The proposed model is verified for both nickel-metal hydride and lithium-ion batteries by comparing the calculated discharge curves with the results from the generic MATLAB model. The model is further validated for the Sinopoly lithium-ion battery (SP-LFP1000AHA) by comparing the model results with the discharge curves from the manufacturer's datasheet at different discharge currents, different cycling numbers, and different temperatures. Simulation results show that the new model can correctly predict voltage separation beyond the nominal zone while maintaining the same level of accuracy as the generic MATLAB model in the exponential and nominal zones.