i have a matrix "timeVectorDaily" that is 364 x 5 in size. This matrix has data in form of decimal days. Eg
734870 734870.2 734870.4 734870.6 734870.8
734871 734871.2 734871.4 734871.6 734871.8
so on
I need to extract only the weekend rows from "timeVectorDaily". The way i coded to find out if it was a weekend or not is by using the weekday function which returns integers 1 through 7 representing Sunday through Saturday. The array "arrayAllDay" that is 364 x 1 in size has this information. Eg
1
2
so on
I have only gotten through to this stage.Can someone help me on how to proceed from here? I need to extract the 1 X 5 for every weekend (1 or 7 returned by the weekday function)
j = length(timeVectorDaily);
arrayAllDay = zeros(j,1);
counter = 0;
for m=1:j
[arrayAllDay(m)] = weekday(timeVectorDaily(m));
if arrayAllDay(m) == 1
counter = counter+1;
elseif arrayAllDay(m) == 7
counter = counter+1;
end
end