I need to keep historical data for when a room is occupied and unoccipied in order to predict occupancy in the near future. In order to do so I am trying to create a timeline (by the minute) using date-time format. Am I on the right track here? Should I be using "datestr()"? Thanks in advance.
occupied = zeros(N,1); %vector for times when the room is occupied
unoccupied = zeros(N,1); %vector for times when the room is unoccupied
for i=1:N %looping the build vectors
occupied(i)=linspace(starttime(i),endtime(i)); j=i+1; unoccupied(i)=linspace(endtime(i),starttime(j)); end
Best Answer