sineval documentation

sineval produces a sinusoid of specified amplitude and phase with a frequency of 1/yr.

For related functions, see sinefit and sinefit_bootstrap documentation.

Back to Climate Data Tools Contents



y = sineval(ft,t)


y = sineval(ft,t) evaluates a sinusoid of given fit parameters ft at times t. Times t can be in datenum, datetime, or datestr format, and parameters ft correspond to the outputs of the sinefit function and can have 2 to 5 elements, which describe the following:


I live in Austin, Texas, where the hottest day of the year occurs around August 12 at around 96 degrees F, and it's about 36 degrees colder in the winter. In ther words, the amplitude of the seasonal sinusoid might be 18 degrees, where the maximum value occurs on julian day 224, and the mean value is 78 degrees. Using these crude numbers, here's a year's climatology for Austin's daily high temperatures:

% t can be just about any date format and it'll be okay:
t = days(1:365);

% Sinusoid of high temperatures:
HighTemp = sineval([18 224 78],t);

axis tight
box off
xlabel 'day of year'
ylabel 'temperature ({\circ}F)'

Author Info

This function is part of the Climate Data Toolbox for Matlab. The sinefit, sineval, and sinefit_bootstrap functions as well as the supporting documentation were written by Chad A. Greene of the University of Texas Institute for Geophysics.