diff --git a/plotting/code/movie_example.m b/plotting/code/movie_example.m new file mode 100644 index 0000000..835bb32 --- /dev/null +++ b/plotting/code/movie_example.m @@ -0,0 +1,54 @@ +clear all +close all +max_frames = 500; + +f_x = 1; +f_y = 1.5; +dt = 2*pi/500; + +f = figure(); +set(f, 'visible', 'off'); +set(f, 'PaperUnits', 'centimeter', 'PaperSize', [2.5, 2.5], ... + 'PaperPosition', [0, 0, 2.5, 2.5], 'Color', 'white') + +writer = VideoWriter('../lecture/images/lissajous.mp4', 'MPEG-4'); +writer.FrameRate = 25; +writer.Quality = 50; + +open(writer); +for i = 1:max_frames + x = sin(f_x * 2 * pi * dt * i); + y = sin(f_y * 2 * pi * dt * i); + scatter(x, y, 30, 'r', 'filled'); + xlim([-1.05, 1.05]) + xticks([-1., 0., 1.]) + ylim([-1.05, 1.05]) + yticks([-1., 0., 1.]) + xlabel('x') + ylabel('y') + drawnow; + frame = getframe(f); + writeVideo(writer, frame); +end +close(writer) + +x_positions = zeros(max_frames, 1); +y_positions = zeros(max_frames, 1); +for i = 1:max_frames + x_positions(i) = sin(f_x * 2 * pi * dt * i); + y_positions(i) = sin(f_y * 2 * pi * dt * i); +end + +f = figure(); +set(f, 'PaperUnits', 'centimeter', 'PaperSize', [5, 5], ... + 'PaperPosition', [0, 0, 5, 5], 'Color', 'white') + +scatter(x_positions, y_positions, 10, 'r', 'filled'); +xlim([-1.05, 1.05]) +xticks([-1., 0., 1.]) +ylim([-1.05, 1.05]) +yticks([-1., 0., 1.]) +xlabel('x') +ylabel('y') + +saveas(f, '../lecture/images/lissajous.png') \ No newline at end of file diff --git a/plotting/lecture/images/lissajous.png b/plotting/lecture/images/lissajous.png new file mode 100644 index 0000000..ee30fed Binary files /dev/null and b/plotting/lecture/images/lissajous.png differ diff --git a/projects/project_vector_strength/vector_strength.tex b/projects/project_vector_strength/vector_strength.tex index 56e8c78..9952c5a 100644 --- a/projects/project_vector_strength/vector_strength.tex +++ b/projects/project_vector_strength/vector_strength.tex @@ -32,8 +32,7 @@ locking, respectively. i.e. the fish's field The data is sampled with 20\,kHz and the spike times are given in seconds. \begin{parts} - \part Plot an average of the single EOD cylces of each fish - together with an respective PSTH. + \part Plot the average EOD waveform of each fish together with an respective PSTH. \part Implement a function that estimates the vector strength between the \textit{eod} and the spikes. \part Create a polar plot that shows the timing of the spikes