Studying on natural convection of nanofluids in enclosures with non-uniform heated walls is important for many engineering applications such as solar energy collection. In this article, we develop a fully higher-order compact (FHOC) finite difference method to investigate the natural convection and heat transfer of nanofluids in an inclined square enclosure with sinusoidal temperature distributions. Numerical simulations have been performed over a range of amplitude ratio, inclination angles, phase deviation, nanoparticles volume fraction, and Rayleigh number. Results show that heat transfer can exchange significantly by increasing the amplitude ratio and inclination angles in nanofluids. Moreover, elevating the nanoparticles volume fraction doesn't always enhance the heat transfer of nanofluids. When the Rayleigh number is low ( = ), the average Nusselt number decreases as the solid volume fraction parameter increases. On the other hand, elevating has favorable effects on the heat transfer of nanofluids when is high (e.g., , ). When , the total heat transfer rate decreases in the order of nanoparticles arranged as Cu, CuO, Al2O3, and TiO2. Finally, a correlated expression of the total average Nusselt number, the Rayleigh number and the solid volume fraction of nanoparticles is empirically obtained.