This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_eyetracker/solution/convert_indices_to_time.m

15 lines
434 B
Matlab

function [time] = convert_indices_to_time(indices, framerate)
% [time] = convert_indices_to_time(indices, frame_rate)
%
% Converts the vector of frame indices to time. The time vector will start
% at zero.
%
% Arguments:
% indices: vecor, the frame indices
% framerate:, scalar, the framerate in Hz
%
% Returns:
% time: vector, the time vector
indices = indices - indices(1);
time = indices / framerate;