The structure function is often used to quantify the intensity of spatial inhomogeneities within turbulent flows. Here, the Small Multifunction Research and Teaching Sonde (SMARTSonde), an unmanned aerial system, is used to measure horizontal variations in temperature and to calculate the structure function of temperature at various heights for a range of separation distances. A method for correcting for the advection of turbulence in the calculation of the structure function is discussed. This advection correction improves the data quality, particularly when wind speeds are high. The temperature structure-function parameter $C_T^2$ can be calculated from the structure function of temperature. Two case studies from which the SMARTSonde was able to take measurements used to derive $C_T^2$ at several heights during multiple consecutive flights are discussed and compared with sodar measurements, from which $C_T^2$ is directly related to return power. Profiles of $C_T^2$ from both the sodar and SMARTSonde from an afternoon case exhibited generally good agreement. However, the profiles agreed poorly for a morning case. The discrepancies are partially attributed to different averaging times for the two instruments in a rapidly evolving environment, and the measurement errors associated with the SMARTSonde sampling within the stable boundary layer.