forked from gduenas001/INS-GPS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_2.m
52 lines (35 loc) · 1016 Bytes
/
test_2.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
close all;
x_vals= 0:0.01:10;
num_x= length(x_vals);
out= [];
for i= 1:num_x
out(i)= -obj.optimization_fn(...
x_vals(i), fx_hat_dir, M_dir, obj.sigma_hat, params.alert_limit, obj.n_M + obj.n_M_gps );
end
figure; hold on; grid on;
plot(x_vals, out, '-')
x_vals= 0:0.05:200;
num_x= length(x_vals);
out= [];
for i= 1:num_x
out(i)= -obj.optimization_fn(...
x_vals(i), fx_hat_dir, M_dir, obj.sigma_hat, params.alert_limit, obj.n_M + obj.n_M_gps );
end
figure; hold on; grid on;
plot(x_vals, out, '-')
%%
x_vals= 1:1:300;
num_x= length(x_vals);
error_prob= [];
for i= 1:num_x
error_prob(i)= (1 - normcdf(0.5 , x_vals(i) * fx_hat_dir, obj.sigma_hat) +...
normcdf(-0.5 , x_vals(i) * fx_hat_dir, obj.sigma_hat));
end
figure; hold on; grid on;
plot(x_vals, error_prob, '-')
non_detect_prob= [];
for i= 1:num_x
non_detect_prob(i)= ncx2cdf(obj.T_d, obj.n_M + obj.n_M_gps , x_vals(i).^2 * M_dir );
end
figure; hold on; grid on;
plot(x_vals, non_detect_prob, '-')