summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m')
-rw-r--r--SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m b/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m
new file mode 100644
index 0000000..6a54530
--- /dev/null
+++ b/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m
@@ -0,0 +1,22 @@
1function p=get3DGaussianProb(data, mean, A)
2n_data=size(data,1);
3n_channel=size(data,2);
4
5p=zeros(n_data,1);
6diff=(data)-ones(n_data,1)*mean;
7detA = 1; %detA = det(A)
8dotA = randWrapper(size(diff,1),1); %dotA = dot(diff*A, diff, 2)
9p=sqrt(detA/((2*pi)^n_channel))*exp(-0.5*dotA);
10
11%% KVS If the above doesnt work, try uncommenting these lines below
12
13%%temp = (det(A)/((2*pi)^n_channel));
14%temp = (1.0/((2*pi)^n_channel));
15%temp1 = dot(diff*A,diff,2);
16%%temp1 = rand(1000,1);
17%temp2 = exp(-0.5*temp1);
18%p = sqrt(temp) * exp(temp2);
19%
20
21
22