-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotAccExample.m
More file actions
executable file
·35 lines (27 loc) · 1.08 KB
/
Copy pathplotAccExample.m
File metadata and controls
executable file
·35 lines (27 loc) · 1.08 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
%% Plot example of accelerometer
addpath /home/mikkel/fieldtrip/fieldtrip
ft_defaults
addpath /home/mikkel/matlab/export_fig/
dirs.export = '/home/mikkel/PD_motor/rebound/export/publication';
data_file = '/home/mikkel/PD_motor/rebound/meg_data/0327/0327_1-ica_raw.fif';
hdr = ft_read_header(data_file);
misc_chan = find(~cellfun(@isempty, strfind(hdr.label, 'MISC')));
cfg = [];
cfg.dataset = data_file;
cfg.continuous = 'yes';
cfg.channel = misc_chan(1:3);
cfg.bpfilter = 'yes';
cfg.bpfreq = [1 195];
alldataACC = ft_preprocessing(cfg);
temp_acc = alldataACC.trial{:};
euc_right = sqrt(sum(temp_acc.^2,1));
plot(euc_right(14000:32000), 'k', 'LineWidth', 1);
ylim([-0.1, 0.3])
set(gcf, 'Position', [100, 100, 1000, 150])
y2 = ylabel({'Acceleration'},'fontsize',6);
set(gca,'xtick',[],'xticklabel','','XColor','none','LineWidth', 1 )
set(gca,'ytick',[],'yticklabel','','YColor','none','LineWidth', 1 )
set(y2, 'HorizontalAlignment','center','VerticalAlignment','bottom')
title(' ');
cd(dirs.export);
export_fig('accExample.png', '-r500', '-p0.05', '-CMYK')