In this study, the second type of Green and Naghdi's thermoelasticity theory is applied to present the vibration of a nanobeam subjected to rectified sine wave heating based upon the nonlocal thermoelasticity theory. Both Young's modulus and thermal conductivity are considered to be linear functions of the temperature. The Laplace transform domain is adopted to solve the governing partial differential equations using the state space approach. Numerical computations are carried out using the inverse of Laplace transforms. The effects of nonlocal parameter and angular frequency on the thermal vibration quantities are discussed. The results of all quantities are illustrated graphically and investigated.