Commit 050c7151 authored by mposthuma's avatar mposthuma
Browse files

Added convert data, save preprocessed data, figures + targets for test_experiment

parents
cfn = pb_clean('cd','C:\Users\marc_\OneDrive\Documents\Studie\STAGE\MATLAB Code\Data\Recordings\test experiment');
l = dir('converted_data*.mat');
if isempty(l)
D = pb_convertdata('block_info_JJH-0007-21-04-15-0001.mat');
save('converted_data_JJH-0001-21-04-15-0001.mat','D');
else
load(l(1).name)
end
l = dir('preprocessed_data*.mat');
if isempty(l)
Data = pb_vPrepData('stim',2,'store',1);
else
load(l(1).name)
end
%%
t = Data.timestamps.optitrack;
correctie = t(1);
t = t-correctie;
Gaze = Data.position.gaze;
cfn = pb_newfig(cfn);
hold on;
axis square;
plot(t,Gaze(:,1))
plot(t,Gaze(:,2))
pb_nicegraph;
legend('azimuth','elevation')
title('Gaze against time')
xlabel('Time')
ylabel('Gaze')
%%
cfn = pb_newfig(cfn);
hold on;
eye = Data.position.pupillabs;
plot(t,eye(:,1))
plot(t,eye(:,2))
pb_nicegraph;
legend('azimuth','elevation')
title('Eye against time')
xlabel('Time')
ylabel('Eye')
%%
stim(:,1) = Data.stimuli.azimuth;
stim(:,2) = Data.stimuli.elevation;
ts_stim = Data.timestamps.stimuli;
ts_stim = ts_stim(3:4:252)-correctie;
cfn = pb_newfig(cfn);
for iP = 1:2
subplot(2,1,iP)
hold on;
plot(t,Gaze(:,iP))
for iS = 1:length(stim)
target = stim(iS,iP)
plot(ts_stim,stim(:,iP),'x')
end
end
pb_nicegraph
%%
for i = 1:3:10
i
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment