summaryrefslogtreecommitdiff
path: root/845/CH7/EX7.10/Ex7_10.sce
diff options
context:
space:
mode:
Diffstat (limited to '845/CH7/EX7.10/Ex7_10.sce')
-rwxr-xr-x845/CH7/EX7.10/Ex7_10.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/845/CH7/EX7.10/Ex7_10.sce b/845/CH7/EX7.10/Ex7_10.sce
new file mode 100755
index 000000000..6c7e359e4
--- /dev/null
+++ b/845/CH7/EX7.10/Ex7_10.sce
@@ -0,0 +1,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"]))