Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update extract_trajectory_narratives.m #113

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions spacetop_prep/events/extract_trajectory_narratives.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,19 @@
motion_onset_feeling(k) = NaN;
motion_dur_feeling(k) = NaN;
else
motion_onset_feeling(k) = (l-1)/60;
if isnan(feelRT)
% no response
if ~isnan(feelRT) && feelRT <= (l-1)/60
% mouse moved, but only moved after a response was
% given (erroneously recorded after 3.5s)
% in this case there was not a valid mouse trajectory
motion_onset_feeling(k) = NaN;
motion_dur_feeling(k) = NaN;
elseif isnan(feelRT)
% mouse moved and no response
motion_onset_feeling(k) = (l-1)/60;
motion_dur_feeling(k) = RT_feeling_adj(k) - motion_onset_feeling(k);
else
% mouse first moved before response
motion_onset_feeling(k) = (l-1)/60;
motion_dur_feeling(k) = RT_feeling(k) - motion_onset_feeling(k);
end
end
Expand Down Expand Up @@ -181,11 +189,19 @@
motion_onset_expectation(k) = NaN;
motion_dur_expectation(k) = NaN;
else
motion_onset_expectation(k) = (l-1)/60;
if isnan(expectRT)
% no response
if ~isnan(expectRT) && expectRT <= (l-1)/60
% mouse moved, but only moved after a response was
% given (erroneously recorded after 3.5s)
% in this case there was not a valid mouse trajectory
motion_onset_expectation(k) = NaN;
motion_dur_expectation(k) = NaN;
elseif isnan(expectRT)
% mouse moved and no response
motion_onset_expectation(k) = (l-1)/60;
motion_dur_expectation(k) = RT_expectation_adj(k) - motion_onset_expectation(k);
else
% mouse first moved before response
motion_onset_expectation(k) = (l-1)/60;
motion_dur_expectation(k) = RT_expectation(k) - motion_onset_expectation(k);
end
end
Expand Down
Loading