Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marc Posthuma
Bachelor Stage
Commits
050c7151
Commit
050c7151
authored
Apr 21, 2021
by
mposthuma
Browse files
Added convert data, save preprocessed data, figures + targets for test_experiment
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
test_experiment.m
0 → 100644
View file @
050c7151
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment