function julday = julian(day,month)

% function julday = julian(day,month)
%
% function that calculates the julian day given
% the day and month of the gregorian calendar
% julian assumes it is a non-leap year

%error checking
if (month > 12)
   error('month must be an integer between 1 and 12');
end

%number of days in each month
numdays = [31 28 31 30 31 30 31 31 30 31 30 31];

if (month==1)
   julday = day;
else
   julday = sum(numdays(1:month-1)) + day;
end
