15,900,589 members
See more:
Hi Everyone,

I am a new user of Matlab, and i would definitely need you help.

I have written a program that Compute the GDOP of four different positions and it run fine with correct result. Now i want to extend it to fine the minimum of these 4 result in order to show that it is the best position.

Here is my code:

C#
```% Exercise n. 1 - 1
% Computing the GDOP at position A,B,C and D

phi_1 = ((3*pi)/4);
phi_2 = (pi / 2);

% The case of a 3 synchronized transmitters at Point A,B,C,D

disp('With 2 transmitter plus transmitter at either Point A,B,C,D and synchronous receiver:')
% Linearization
% The linearization point is the origin of the coordinate system

phi_A = pi/2;

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_A), sin(phi_A)];

H = [a1; a2 ; a3];

% Geometric matrix

G = inv(H.' * H);
HDOP_A = sqrt(G(1,1) + G(2,2)) ;

GDOP_A = HDOP_A

phi_B = (2*pi)/3;

% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_B), sin(phi_B)];

% Note: different structure of H matrix
H = [a1; a2; a3];

% Geometric matrix
G = inv(H.' * H);
HDOP_B = sqrt(G(1,1) + G(2,2));
GDOP_B = HDOP_B

phi_C = pi;

% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_C), sin(phi_C)];

% Note: different structure of H matrix
H = [a1; a2; a3];

% Geometric matrix
G = inv(H.' * H);
HDOP_C = sqrt(G(1,1) + G(2,2));
GDOP_C = HDOP_C

phi_D = (3*pi) / 2;

% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_D), sin(phi_D)];

% Note: different structure of H matrix
H = [a1; a2; a3];

% Geometric matrix
G = inv(H.' * H);
HDOP_D = sqrt(G(1,1) + G(2,2));
GDOP_D = HDOP_D

% The case of 3 unsynchronized transmitters at Point,A,B,C,D
disp('With 2 transmitter plus transmitter at either Point A,B,C,D and asynchronous receiver:')

phi_A = pi/2;
% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_A), sin(phi_A)];

H = [a1, 1; a2, 1; a3, 1];

% Geometric matrix
G = inv(H.' * H); % warning if H.'*H is singular
HDOP_UA = sqrt(G(1,1) + G(2,2));
GDOP_UA = sqrt(trace(G))

phi_B = (2*pi)/3;
% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_B), sin(phi_B)];

H = [a1, 1; a2, 1; a3, 1];

% Geometric matrix
G = inv(H.' * H); % warning if H.'*H is singular
HDOP_UB = sqrt(G(1,1) + G(2,2)) ;
GDOP_UB = sqrt(trace(G))

phi_C = pi;
% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_C), sin(phi_C)];

H = [a1, 1; a2, 1; a3, 1];

% Geometric matrix
G = inv(H.' * H);
HDOP_UC = sqrt(G(1,1) + G(2,2));
GDOP_UC = sqrt(trace(G))

phi_D = (3*pi) /2;
% Linearization
% The linearization point is the origin of the coordinate system

a1 = [cos(phi_1), sin(phi_1)];
a2 = [cos(phi_2), sin(phi_2)];
a3 = [cos(phi_D), sin(phi_D)];

H = [a1, 1; a2, 1; a3, 1];

% Geometric matrix
G = inv(H.' * H); % warning if H.'*H is singular
HDOP_UD = sqrt(G(1,1) + G(2,2)) ;
GDOP_UD = sqrt(trace(G))```
Posted