First, is yy really a Julian day array, or is it a Day Of the Year (DOY) number array? There are quite a few websites etc out there that erroneously refer to DOY numbers as Julian Day numbers.
Second, if yy really is a Julian day array, be advised that datenum does NOT return a Julian day number. It returns the days (and fractions of day) since January 0, 0000.
Maybe you could clarify what you are trying to do and why you are using the calculations you show above?
EDIT:
To convert between Julian Day numbers and Serial Date Numbers you can use the following relationship:
Julian_Day = Serial_Date_Number + 1721058.5
So in your case, if yy are Julian Day values and you want to convert them to Serial Date Numbers (i.e., compatible with the datenum function), then
yy_sdn = yy - 1721058.5;
yy_dv = datevec(yy_sdn);
Keep in mind that this is a straight conversion with no assumptions about UTC or TT etc. E.g., if you start with Julian Day UTC values, you will get UTC datevec values as a result. If you start with Julian Day TT values, you will get TT datevec values as a result. Etc.
Best Answer