-
Notifications
You must be signed in to change notification settings - Fork 5
/
show_chanWeights.m
54 lines (43 loc) · 1.01 KB
/
show_chanWeights.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
51
52
53
54
function show_chanWeights(chanVal)
% This function shows the location of one channel on head.
%
% INPUTS:
% chanVal is a vector with the weight of the channels to be plotted.
%
% @ 2010 Jinyin Zhang -- jinyinz@andrew.cmu.edu
selNum=1:306;
cortIX=find(mod(selNum,3)~=0);
selNum=selNum(cortIX);
resolution = 200;
% Load sensor location
load sensors102.mat
x = c102(:,2);
y = c102(:,3);
xlin = linspace(min(x),max(x)+35,resolution);
ylin = linspace(min(y),max(y),resolution);
r = 5;
MinChanVal=min(chanVal);
z=ones(length(x),1)*MinChanVal;
selSen=ceil(selNum/3);
maxSen=max(selSen);
for senIX=1:maxSen
currVal=zeros(2,1);
for chanIX=1:2
chanInd=(senIX-1)*3+chanIX;
tmp=find(selNum==chanInd);
if (length(tmp)~=0)
currVal(chanIX)=chanVal(tmp);
end
end
z(senIX)=max(currVal);
end
[X, Y] = meshgrid(xlin, ylin);
Z = griddata(x, y, z, X, Y, 'cubic');
hold on
pcolor(X, Y, Z);
axis equal
set(gca, 'Color', 'w')
axis off
shading interp
colorbar('location','East');
return