0001 clear; 0002 c = 299792.458; % speed of light in km/s 0003 % create an array of structures, representing the positions of each 0004 % satellite in 3D space and the associated travel time of the signal 0005 % to the receiver 0006 sat = struct( 'x', 15600, 'y', 7540, 'z', 20140, 't', 0.07074 ); 0007 sat(2).x = 18760; sat(2).y = 2750; sat(2).z = 18610; sat(2).t = 0.07220; 0008 sat(3).x = 17610; sat(3).y = 14630; sat(3).z = 13480; sat(3).t = 0.07690; 0009 sat(4).x = 19170; sat(4).y = 610; sat(4).z = 18390; sat(4).t = 0.07242; 0010 % our initial guess of the location of the receiver 0011 x0 = [ 0 0 6370 0 ]'; % [ x y z d ] 0012 % find the position and relative clock error of the receiver 0013 % using Multivariate Newtons Method 0014 [ x y z d ] = solveNavEqns1( sat, x0, c ); 0015 % for this example, the results should be as follows: 0016 % x = -41.7 0017 % y = -16.8 0018 % z = 6370.0 0019 % d = -0.003