MATLAB: Fill vector with missing values

fillmissingvaluesvector

Hello, i have vectors that represent the day-,month and year values.As you can see in the example below, the day an month vectors do not start with 1, what would be 1. Januar. The vector also dont end with 31 and 12, what would be 31. December. Does anyone have any suggestion how i can first check what is the starting value of day and month and thenn fill the missing valuse, so i have a complete year? thanks a lot!
Day: Month: Year:
6 8 1993
7 8 1993
8 8 1993
9 8 1993
. . .
. . .
. . .
3 11 1993

Best Answer

yyear = [Year,Month,Day];
y1 = datevec(datenum([Year(1) 1 1]):datenum([Year(1) 12 31]));
y1 = y1(:,1:3);
missing_values = y1(~ismember(y1,yyear,'rows'),:);