Kaynağa Gözat

Update for GNU Octave

Pjotir 1 ay önce
ebeveyn
işleme
1b6f6fe871

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 15
Homework2/problem1_popgrowthplot.m


+ 6 - 23
Homework2/problem2_piformula.m

@@ -1,8 +1,9 @@
-fprintf("%.15f", approx_pi(1)) %[output:8ad5a476]
-fprintf("%.15f", approx_pi(3)) %[output:494950f9]
-fprintf("%.15f", approx_pi(5)) %[output:49f53ba2]
-fprintf("%.15f", approx_pi(10)) %[output:2fabe6fd]
-
+function main()
+    fprintf("%.15f\n", approx_pi(1));
+    fprintf("%.15f\n", approx_pi(3));
+    fprintf("%.15f\n", approx_pi(5));
+    fprintf("%.15f\n", approx_pi(10));
+end
 
 function r = approx_pi(steps)
     total = 0;
@@ -11,21 +12,3 @@ function r = approx_pi(steps)
     end
     r = 2 * sqrt(3) * total;
 end
-
-%[appendix]{"version":"1.0"}
-%---
-%[metadata:view]
-%   data: {"layout":"onright"}
-%---
-%[output:8ad5a476]
-%   data: {"dataType":"text","outputData":{"text":"3.079201435678004","truncated":false}}
-%---
-%[output:494950f9]
-%   data: {"dataType":"text","outputData":{"text":"3.137852891595680","truncated":false}}
-%---
-%[output:49f53ba2]
-%   data: {"dataType":"text","outputData":{"text":"3.141308785462883","truncated":false}}
-%---
-%[output:2fabe6fd]
-%   data: {"dataType":"text","outputData":{"text":"3.141593304503081","truncated":false}}
-%---

+ 6 - 16
Homework2/problem3_shortestpath.m

@@ -1,8 +1,10 @@
-% Constants for test
-a = 3; b = 5; d = 12; w = 1;
+function main()
+    % Constants for test
+    a = 3; b = 5; d = 12; w = 1;
 
-% Testing all possible bridge positions (0 to d)
-[bridge_pos, path_distance] = fminbnd(@(x) calc_path(a,b,w,d,x), 0, d) %[output:32ce9065] %[output:590b847e]
+    % Testing all possible bridge positions (0 to d)
+    [bridge_pos, path_distance] = fminbnd(@(x) calc_path(a,b,w,d,x), 0, d)
+end
 
 % a : vertical distance from town A to the river
 % b : vertical distance from town B to the river
@@ -12,15 +14,3 @@ a = 3; b = 5; d = 12; w = 1;
 function path_distance = calc_path(a, b, w, d, x)
     path_distance = sqrt(x^2+a^2) + sqrt((d-x)^2+b^2) + w;
 end
-
-%[appendix]{"version":"1.0"}
-%---
-%[metadata:view]
-%   data: {"layout":"onright"}
-%---
-%[output:32ce9065]
-%   data: {"dataType":"textualVariable","outputData":{"name":"bridge_pos","value":"4.5000"}}
-%---
-%[output:590b847e]
-%   data: {"dataType":"textualVariable","outputData":{"name":"path_distance","value":"15.4222"}}
-%---

+ 0 - 7
Homework2/problem4_kitchoffslaw.m

@@ -1,7 +0,0 @@
-
-
-%[appendix]{"version":"1.0"}
-%---
-%[metadata:view]
-%   data: {"layout":"onright"}
-%---

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor