In nuclear power plants, steam generators are important parts. This paper introduces a U-tube steam generator (UTSG) model implemented completely using MATLAB environment. The UTSG consists of four regions: upward and downward primary regions, upward and downward metal tube regions, and secondary regions, which contain heat transfer region, steam separation region, and subcooled water region. Governing equations are derived by applying energy and mass conservation equations in all regions. Accurate functions that describe the relationships between thermodynamic properties of the saturated steam are introduced instead of interpolation method that is widely used. Steady state and one transient case are presented as well.