A coupled LBGK scheme, constituting of two independent distribution functions describing velocity and temperature respectively, is established in this paper. Chapman-Enskog expansion, a procedure to prove the consistency of this mesoscopic method with macroscopic conservation laws, is also conducted for both lattice scheme of velocity and temperature, as well as a simple introduction on the common used DnQb model. An efficient coding manner for Matlab is proposed in this paper, which improves the coding and calculation efficiency at the same time. The compact and efficient scheme is then applied in the simulation of the famous and well-studied Rayleigh-Benard convection, which is common seen as a representative heat convection problem in modern industries. The results are interesting and reasonable, and meet the experimental data well. The stability of this scheme is also proved through different cases with a large range of Rayleigh number, until 2 million.