MATLAB: How to index time interval more efficiently

create vectorefficient codematrix table

Do you mind describing what this code is supposed to do?

Best Answer

Hi balandong,
Here is one way to accomplish this. At present the function in the script below has no semicolons at the end of a couple of lines so it illustrates what is going on.
s.days = 3
owl_awake = owl(s.days,[0 8])
owl_hide = owl(s.days,[9 20])
% etc.
function hoursvec = owl(ndays,interval)
rep24 = 24*(0:ndays-1);
[a b] = meshgrid(rep24,interval)
apb = (a+b)
hoursvec = apb(:)';
end
If I may ask, what is the owl doing between the hours of 2000 and 2400?
Related Question