I have an excel file as attached. In the second column, i have the 'entry time' and third column have 'exit time'. In the 'exit time', there are few values missing. I am doing an functional operation, which takes the 'entry time' and 'exit time'. When i perform this, i am getting an error "Subscript indices must either be real positive integers or logicals", due to the presence of nan's. Any help to solve this will be appreciated.
real_time_vec = str2double(changed_ts_to_seconds{1,2}(:,5)); %choose good nest data text file
frame_rate_played_video = 8; colony_data = 'ants_entry_exit_goodnest_14.0164.xlsx'; read_colony_observation_data_goodnest = xlsread(colony_data); time_data_observation = floor(read_colony_observation_data_goodnest(:,2:3)*60); entry_times_to_nest = time_from_videos_to_second_convertor(time_data_observation,frame_rate_played_video,real_time_vec);
The function 'time_from_videos_to_second_convertor' is shown below
function [real_time] = time_from_videos_to_second_convertor(time_data_observation,frame_rate_played_video,real_time_vec) for ii = 1:length(time_data_observation) frame_id = time_data_observation*frame_rate_played_video; real_time = real_time_vec(frame_id); end
Best Answer