The dataset provides the source codes of MATLAB program for building dynamic thermophysical process modelling of a typical 3-occupant residential apartment identified in the HSCW (Hot Summer and Cold Winter) zone of China. The plain layout of the 3-occupant residential apartment is provided in a separate introduction document. Three versions of programs are available to calculate the cases of free room temperatures without energy supply, ideal building heating and cooling loads with fixed room target temperatures, and building heating and cooling loads with room target temperature control bands, respectively. The model is developed based on the State-Space Method, with a view to investigating the impact of thermal mass of external walls on residential buildings in the part time part space heating and cooling in the HSCW zone. A small time interval can be set manually to get a high-resolution model in particular for the intermittent occupancy pattern. Different scenarios of heating/cooling modes, thermal mass and thermal insulation placements of external walls are considered and three representative cities Chongqing, Changsha and Shanghai in the HSCW zone are chosen as the input weather data. Options in the programs can be chosen and relevant default parameter settings can be changed to be fit for the building simulations of different scenarios.