From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- .../localization/src/matlab/get3DGaussianProb.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m (limited to 'SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m') 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 @@ +function p=get3DGaussianProb(data, mean, A) +n_data=size(data,1); +n_channel=size(data,2); + +p=zeros(n_data,1); +diff=(data)-ones(n_data,1)*mean; +detA = 1; %detA = det(A) +dotA = randWrapper(size(diff,1),1); %dotA = dot(diff*A, diff, 2) +p=sqrt(detA/((2*pi)^n_channel))*exp(-0.5*dotA); + +%% KVS If the above doesnt work, try uncommenting these lines below + +%%temp = (det(A)/((2*pi)^n_channel)); +%temp = (1.0/((2*pi)^n_channel)); +%temp1 = dot(diff*A,diff,2); +%%temp1 = rand(1000,1); +%temp2 = exp(-0.5*temp1); +%p = sqrt(temp) * exp(temp2); +% + + + -- cgit v1.2.2