-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfigure4d.m
50 lines (38 loc) · 1.24 KB
/
figure4d.m
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
%% Illustration of RSA-based 'neurometric mapping', forward model
% Bernhard Spitzer, 2016
clear all;
kaps=[0.5 2 2]; % exponents kappa (k)
offs=[ 0 0 0.3]; % offset bias (b)
figure;
for ka=1:length(kaps)
kap=kaps(ka);
off=offs(ka);
%% 'neurometric'
f=[-1:0.4:1];
neurom=abs((off+f).^kap).*sign(off+f);
subplot(3,length(kaps),(ka-1).*length(kaps)+1);
plot(neurom,'Color',[0.5 0.5 0.5],'Linewidth',1.5); hold on; plot(zeros(1,6),'k--'); xlim([0.5 6.5])
%% distance (12 by 12; 6 red, 6 green)
p=[neurom neurom];
plotDV=[p(1:6);p(7:12)]';
dist=[];
for i=1:12
for j=1:12
dist(i,j)=abs(p(i)-p(j));
end
end
subplot(3,length(kaps),(ka-1).*length(kaps)+2);
imagesc(dist); colormap('hot');
set(gca,'xtick',[]); set(gca,'ytick',[]);
%% response-mapped distance (dist x category red/green; 12 by 12)
p=[-neurom neurom];
distXcat=[];
for i=1:12
for j=1:12
distXcat(i,j)=abs(p(i)-p(j));
end
end
subplot(3,length(kaps),(ka-1).*length(kaps)+3);
imagesc(distXcat); colormap('hot');
set(gca,'xtick',[]); set(gca,'ytick',[]);
end