forked from monagarvert/eLife-2017-data-and-analysis-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_FigS3_3B.m
More file actions
34 lines (29 loc) · 1.07 KB
/
generate_FigS3_3B.m
File metadata and controls
34 lines (29 loc) · 1.07 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
%% Figure 3 - figure supplement 3B
%
% parameter estimates extracted from ROI 5 (anatomically defined)
% data format: subjects x runs x object trial t-1 x object trial t
%
%%
clear all
close all
% Load data from ROI5
load('ROI5.mat') % format: subj x obj trial t-1 x obj trial t
roi5 = squeeze(mean(roi5,2)); % average across experimental runs
load('time.mat');
%% Generate graph
% dist: distance between objects
dist = generate_graph('off'); % 'on': plot graph structure, 'off': do not plot graph structure
%% Linear regression: distance & time
for subj = 1:23
[beta(subj,:)] = regress(roi5(subj,eye(7)~=1)',[ones(42,1),dist(eye(7)~=1),time(subj,eye(7)~=1)']);
end
figure;
bar(mean(beta(:,2:end)),'facecolor',[0.5 0.5 0.5],'edgecolor','none')
hold on
errorbar(1:size(beta,2)-1,mean(beta(:,2:end)),std(beta(:,2:end))/sqrt(23),'k','linestyle','none')
set(gcf,'color','w')
box off
set(gca,'TickDir','out','XTickLabel',{'Link distance','Time'},'fontsize', 15,'YTick',0:0.1:0.4)
ylabel('Linear regression weighting (a.u.)')
ylim([0 0.16])
set(gca,'YTick',0:0.04:0.16)