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_vector_strength/solution/main.m

16 lines
470 B
Matlab

% partial solution for the vector strength project
clear
files = dir('../data/*.mat');
dt = 1./20000;
vs = zeros(length(files), 1);
for i = 1:length(files)
load(strcat('../data/', files(i).name))
eod_time = (1:length(eod)) .* dt;
zero_crossings = zeroCrossings(eod, eod_time);
while spike_times(1) <= zero_crossings(1)
spike_times(1) = [];
end
phases = spikeEodPhase(spike_times, zero_crossings);
vs(i) = vectorStrength(phases);
end