Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marc van Wanrooij
panda
Commits
74cf1f61
Commit
74cf1f61
authored
Oct 05, 2016
by
Marc van Wanrooij
Browse files
no message
parent
60313847
Changes
6
Hide whitespace changes
Inline
Side-by-side
Audition/HRTF/pa_audiogravicHRTFs.m
View file @
74cf1f61
...
@@ -35,7 +35,7 @@ for ii = 1:2
...
@@ -35,7 +35,7 @@ for ii = 1:2
cd
(
'/Users/marcw/matlab/PandA/Audition/HRTF/Knowles'
);
cd
(
'/Users/marcw/matlab/PandA/Audition/HRTF/Knowles'
);
wavfile
=
'snd399.wav'
;
wavfile
=
'snd399.wav'
;
wav
=
wav
read
(
wavfile
);
wav
=
audio
read
(
wavfile
);
...
...
Coordinate/pa_sky2azel.m
View file @
74cf1f61
function
[
AZ
,
EL
]
=
pa_sky2azel
(
X
,
Y
)
function
[
AZ
,
EL
,
R
,
Phi
]
=
pa_sky2azel
(
X
,
Y
)
% SKY2AZEL Transfrom SKY to double polar coordinates.
% SKY2AZEL Transfrom SKY to double polar coordinates.
% [AZ,EL] = SKY2AZEL(R,Phi) transforms corresponding elements of data
% [AZ,EL] = SKY2AZEL(R,Phi) transforms corresponding elements of data
% stored in SKY coordinates R (Ring Number), Phi (Spoke Number)
% stored in SKY coordinates R (Ring Number), Phi (Spoke Number)
...
...
DoingBayesianDataAnalysis/plotPost.m
View file @
74cf1f61
...
@@ -45,20 +45,20 @@ postSummary.hdiHigh = HDI(2);
...
@@ -45,20 +45,20 @@ postSummary.hdiHigh = HDI(2);
%% Plot histogram.
%% Plot histogram.
hold
on
hold
on
if
isempty
(
breaks
)
if
isempty
(
breaks
)
by
=
(
HDI
(
2
)
-
HDI
(
1
))/
18
;
by
=
(
HDI
(
2
)
-
HDI
(
1
))/
18
;
breaks
=
unique
([
min
(
paramSampleVec
):
by
:
max
(
paramSampleVec
)
max
(
paramSampleVec
)]);
nbreaks
=
floor
((
max
(
paramSampleVec
)
-
min
(
paramSampleVec
))/
by
);
breaks
=
linspace
(
min
(
paramSampleVec
),
max
(
paramSampleVec
),
nbreaks
);
end
end
N
=
hist
(
paramSampleVec
,
breaks
);
N
=
histc
(
paramSampleVec
,
breaks
);
db
=
mean
(
diff
(
breaks
));
db
=
mean
(
diff
(
breaks
));
histInfo
.
N
=
N
;
histInfo
.
N
=
N
;
histInfo
.
density
=
N
.
/
db
/
sum
(
N
);
histInfo
.
density
=
N
.
/
db
/
sum
(
N
);
histInfo
.
breaks
=
breaks
;
if
~
showCurve
if
~
showCurve
% h = bar(breaks,histInfo.density,'style','histc'); % used to work
% h = bar(breaks,histInfo.density,'style','histc'); % used to work
h
=
bar
(
breaks
,
histInfo
.
density
);
h
=
bar
(
breaks
,
histInfo
.
density
,
1
);
delete
(
findobj
(
'marker'
,
'*'
));
% Matlab bug?
set
(
h
,
'FaceColor'
,
col
,
'EdgeColor'
,
'w'
);
set
(
h
,
'FaceColor'
,
col
,
'EdgeColor'
,
'w'
);
shading
flat
end
end
if
showCurve
if
showCurve
[
densCurve
.
y
,
densCurve
.
x
]
=
ksdensity
(
paramSampleVec
);
[
densCurve
.
y
,
densCurve
.
x
]
=
ksdensity
(
paramSampleVec
);
...
@@ -72,18 +72,18 @@ xlim(xl);
...
@@ -72,18 +72,18 @@ xlim(xl);
title
(
main
);
title
(
main
);
set
(
gca
,
'YTick'
,
yaxt
);
set
(
gca
,
'YTick'
,
yaxt
);
cenTendHt
=
0.9
*
nanmax
(
histInfo
.
density
);
cenTendHt
=
1.05
*
nanmax
(
histInfo
.
density
);
cvHt
=
0.7
*
nanmax
(
histInfo
.
density
);
cvHt
=
0.7
*
nanmax
(
histInfo
.
density
);
ROPEtextHt
=
0.55
*
nanmax
(
histInfo
.
density
);
ROPEtextHt
=
0.55
*
nanmax
(
histInfo
.
density
);
% Display mean or mode:
% Display mean or mode:
if
~
showMode
if
~
showMode
str
=
[
'mean = '
num2str
(
postSummary
.
mean
,
3
)];
str
=
[
'mean = '
num2str
(
postSummary
.
mean
,
2
)];
text
(
postSummary
.
mean
,
cenTendHt
,
str
,
'HorizontalAlignment'
,
'center'
);
text
(
postSummary
.
mean
,
cenTendHt
,
str
,
'HorizontalAlignment'
,
'center'
);
else
else
[
~
,
indx
]
=
max
(
mcmcDensity
.
y
);
[
~
,
indx
]
=
max
(
mcmcDensity
.
y
);
modeParam
=
mcmcDensity
.
x
(
indx
);
modeParam
=
mcmcDensity
.
x
(
indx
);
str
=
[
'mode = '
num2str
(
postSummary
.
mode
,
3
)];
str
=
[
'mode = '
num2str
(
postSummary
.
mode
,
2
)];
text
(
modeParam
,
cenTendHt
,
str
,
'HorizontalAlignment'
,
'center'
);
text
(
modeParam
,
cenTendHt
,
str
,
'HorizontalAlignment'
,
'center'
);
end
end
...
@@ -100,7 +100,7 @@ if ~isempty(compVal)
...
@@ -100,7 +100,7 @@ if ~isempty(compVal)
end
end
%% Display the ROPE.
%% Display the ROPE.
if
~
isempty
(
ROPE
)
if
~
isempty
(
ROPE
)
ropeCol
=
[
.
5
0
0
];
ropeCol
=
[
0
0
0
.5
];
pcInROPE
=
sum
(
paramSampleVec
>
ROPE
(
1
)
&
paramSampleVec
<
ROPE
(
2
))/
length
(
paramSampleVec
);
pcInROPE
=
sum
(
paramSampleVec
>
ROPE
(
1
)
&
paramSampleVec
<
ROPE
(
2
))/
length
(
paramSampleVec
);
plot
(
ROPE
([
1
1
]),[
0
0.96
*
ROPEtextHt
],
':'
,
'LineWidth'
,
2
,
'Color'
,
ropeCol
);
plot
(
ROPE
([
1
1
]),[
0
0.96
*
ROPEtextHt
],
':'
,
'LineWidth'
,
2
,
'Color'
,
ropeCol
);
plot
(
ROPE
([
2
2
]),[
0
0.96
*
ROPEtextHt
],
':'
,
'LineWidth'
,
2
,
'Color'
,
ropeCol
);
plot
(
ROPE
([
2
2
]),[
0
0.96
*
ROPEtextHt
],
':'
,
'LineWidth'
,
2
,
'Color'
,
ropeCol
);
...
@@ -124,11 +124,11 @@ axis square;
...
@@ -124,11 +124,11 @@ axis square;
%% Display the HDI.
%% Display the HDI.
plot
(
HDI
,[
0
0
],
'k-'
,
'LineWidth'
,
4
);
plot
(
HDI
,[
0
0
],
'k-'
,
'LineWidth'
,
4
);
str
=
[
num2str
(
100
*
credMass
,
2
)
'% HDI'
];
str
=
[
num2str
(
100
*
credMass
,
2
)
'% HDI'
];
text
(
mean
(
HDI
),
ydiff
/
20
+
ydiff
/
2
0
,
str
,
'HorizontalAlignment'
,
'center'
);
text
(
mean
(
HDI
),
ydiff
/
4
0
,
str
,
'HorizontalAlignment'
,
'center'
);
str
=
num2str
(
HDI
(
1
),
3
);
str
=
num2str
(
HDI
(
1
),
3
);
text
(
HDI
(
1
),
ydiff
/
2
0
,
str
,
'HorizontalAlignment'
,
'center'
);
text
(
HDI
(
1
),
-
ydiff
/
4
0
,
str
,
'HorizontalAlignment'
,
'center'
);
str
=
num2str
(
HDI
(
2
),
3
);
str
=
num2str
(
HDI
(
2
),
3
);
text
(
HDI
(
2
),
ydiff
/
2
0
,
str
,
'HorizontalAlignment'
,
'center'
);
text
(
HDI
(
2
),
-
ydiff
/
4
0
,
str
,
'HorizontalAlignment'
,
'center'
);
NIRS/nirs_av_figure5_onesubject.m
View file @
74cf1f61
...
@@ -17,7 +17,7 @@ end
...
@@ -17,7 +17,7 @@ end
Txt
=
Txt
(
2
:
end
,:);
Txt
=
Txt
(
2
:
end
,:);
figure
(
2
)
figure
(
2
)
clf
clf
subj
=
1
;
subj
=
1
7
;
sel
=
nmbr
==
subj
;
sel
=
nmbr
==
subj
;
fnames
=
{
d
(
sel
)
.
name
};
fnames
=
{
d
(
sel
)
.
name
};
nfiles
=
numel
(
fnames
);
nfiles
=
numel
(
fnames
);
...
...
NIRS/nirs_av_figure7_glm.m
View file @
74cf1f61
...
@@ -68,8 +68,8 @@ sel = A(end-4:end)<V(end-4:end);
...
@@ -68,8 +68,8 @@ sel = A(end-4:end)<V(end-4:end);
% [sum(sel) length(A(end-4:end))]
% [sum(sel) length(A(end-4:end))]
keyboard
%
keyboard
return
%
return
[
H
,
P
,
CI
]
=
ttest
(
A
,
V
);
[
H
,
P
,
CI
]
=
ttest
(
A
,
V
);
[
P
,
H
]
=
ranksum
(
A
,
V
);
[
P
,
H
]
=
ranksum
(
A
,
V
);
...
@@ -453,4 +453,4 @@ xlswrite('Wilcoxon.xlsx',M,'Modality')
...
@@ -453,4 +453,4 @@ xlswrite('Wilcoxon.xlsx',M,'Modality')
% xlswrite('Wilcoxon.xlsx',D,'Cohort')
% xlswrite('Wilcoxon.xlsx',D,'Cohort')
%%
%%
keyboard
%
keyboard
Tmp/tmp.m
View file @
74cf1f61
cd('/Users/marcw/DATA/SS-0001-15-10-16');
1e-3*8.3e-11/15.5e-11
\ No newline at end of file
fname = 'SS-0001-15-10-16-0001.mat';
load(fname);
SupSac = pa_supersac(Sac,Stim,2,1);
unique(SupSac(:,29))
sel = ismember(SupSac(:,30),300:399)
&
ismember(SupSac(:,29),[55 65]);
x = SupSac(sel,24);
y = SupSac(sel,9);
plotloc(x,y,'diag',true);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment