blob: 6c7e359e4664ea06f65d57a2e244de3ca298c8e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
//Etample 7.10
clc
clear
t = 0:10:80;
a = [30 31.63 33.34 35.47 37.75 40.33 43.25 46.69 50.67];
h = t(2) - t(1);
n = length(t);
Is13 = a(1);
for i = 2:n-1
rem2 = i-fix(i./2).*2;
if rem2 == 0 then
Is13 = Is13 + 4*a(i);
else
Is13 = Is13 + 2*a(i);
end
end
Is13 = (Is13 + a(n))/10^3;
Is13 = round(h/3*Is13*10^4)/10^4;
disp(strcat(["v = ",string(Is13)," km/s"]))
|