-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcombine_tf_data.m
More file actions
58 lines (56 loc) · 2.47 KB
/
Copy pathcombine_tf_data.m
File metadata and controls
58 lines (56 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
clear all;
close all;
%combine_tf_data
pt = 'P011';
files = ['C:\Users\matth\OneDrive\BCM\PAAT Analysis\data\',pt];
pt_files = dir(fullfile(files));
combined_approachful_L = [];
combined_avoidant_L = [];
combined_approachful_R = [];
combined_avoidant_R = [];
combined_reward_L = [] ;
combined_negative_L = [] ;
combined_reward_R = [] ;
combined_negative_R = [] ;
for file=1:length(pt_files)
if contains(pt_files(file).name,'1.mat')
disp(pt_files(file).name)
tf_data_file = fullfile(pt_files(file).folder,pt_files(file).name);
load(tf_data_file,'approachful_LFP');
load(tf_data_file,'avoidant_LFP');
% load(tf_data_file,'reward_LFP');
% load(tf_data_file,'negative_stimuli_LFP');
combined_approachful_L = [combined_approachful_L;approachful_LFP];
combined_avoidant_L = [combined_avoidant_L;avoidant_LFP];
% combined_reward_L = [combined_reward_L;reward_LFP] ;
% combined_negative_L = [combined_negative_L;negative_stimuli_LFP] ;
end
if contains(pt_files(file).name,'2.mat')
tf_data_file = fullfile(pt_files(file).folder,pt_files(file).name);
load(tf_data_file,'approachful_LFP');
load(tf_data_file,'avoidant_LFP');
% load(tf_data_file,'reward_LFP');
% load(tf_data_file,'negative_stimuli_LFP');
combined_approachful_R = [combined_approachful_R;approachful_LFP];
combined_avoidant_R = [combined_avoidant_R;avoidant_LFP];
% combined_reward_R = [combined_reward_R;reward_LFP] ;
% combined_negative_R = [combined_negative_R;negative_stimuli_LFP] ;
end
end
patient = pt;
sfreq=250;
chan_L = [pt,': Combined Left Decision'];
chan_R = [pt,': Combined Right Decision'];
time = linspace(-6,3,sfreq*9);
plot_spectrograms(combined_approachful_L,combined_avoidant_L,time,chan_L,pt,[])
bandpassed_LFP(combined_approachful_L,combined_avoidant_L,time,chan_L,pt,[])
plot_spectrograms(combined_approachful_R,combined_avoidant_R,time,chan_R,pt,[])
bandpassed_LFP(combined_approachful_R,combined_avoidant_R,time,chan_R,pt,[])
% chan_L = [pt,':Combined Left Stimulus'];
% chan_R = [pt,':Combined Right Stimulus'];
%
% time = linspace(-2,5,sfreq*7);
% plot_spectrograms(combined_reward_L,combined_negative_L,time,chan_L,patient,[])
% bandpassed_LFP(combined_reward_L,combined_negative_L,time,chan_L,patient,[])
% plot_spectrograms(combined_reward_R,combined_negative_R,time,chan_R,patient,[])
% bandpassed_LFP(combined_reward_R,combined_negative_R,time,chan_R,patient,[])