forked from poliastro/validation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex10_1.m
36 lines (33 loc) · 1.1 KB
/
ex10_1.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
% -----------------------------------------------------------------
%
% Ex10_1.m
%
% this file demonstrates example 10-1.
%
% companion code for
% fundamentals of astrodyanmics and applications
% 2007
% by david vallado
%
% (w) 719-573-2600, email dvallado@agi.com
%
% *****************************************************************
%
% current :
% 7 jun 07 david vallado
% original
% changes :
% 13 feb 07 david vallado
% original baseline
%
% *****************************************************************
% problem 1
fprintf(1,'problem 1 --------------------------\n');
xo=[1 2 3 4 5 6 7 8];
yo=[1 1 2 3 3 4 4 6];
fprintf(1,'xo %3i %3i %3i %3i %3i %3i %3i %3i \n',xo);
fprintf(1,'yo %3i %3i %3i %3i %3i %3i %3i %3i \n',yo);
ata=[8 sum(xo); sum(xo) sum(xo*xo')]
atb=[sum(yo); sum(xo*yo')]
atai = inv(ata)
ans= atai*atb