summaryrefslogtreecommitdiff
path: root/Scripts/hw03
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2024-12-21 20:11:19 +0100
committerChristian Kolset <christian.kolset@gmail.com>2024-12-21 20:11:19 +0100
commit26f9500d3fe5073788354102d157cc5e7978c740 (patch)
tree3ceeef96fd8e6f693f7012fa8bb5b8efaf9f0b6b /Scripts/hw03
parentd94f8b703beb9c671631f6b065e749b84378ba77 (diff)
Renamed and re-organized files in Scripts/ directory
Diffstat (limited to 'Scripts/hw03')
-rw-r--r--Scripts/hw03/hw3.m37
1 files changed, 0 insertions, 37 deletions
diff --git a/Scripts/hw03/hw3.m b/Scripts/hw03/hw3.m
deleted file mode 100644
index 7caf82c..0000000
--- a/Scripts/hw03/hw3.m
+++ /dev/null
@@ -1,37 +0,0 @@
-% HW3
-% Author: Christian Kolset
-% Date: 20.5.21
-
-%% HW3
-% Specify the variables needed to solve this problem (ie. height of each section, diameter, radiaus, ...)
-% It is alwasy easier to work with variables (diameter_cyl = 25) than to use numbers everywhere, since a
-% diameter indicates something specific but the number 25 could mean anything
-diameter_Bot = 25;
-r_bot = diameter_Bot/2;
-h_cone = h-19;
-
-% Specify the height of the water
-h = 20
-% You can comment / uncomment lines below for testing. This will overwrite the previous line for h = 20.
-% For submission, make sure all of the following lines are commented out and h = 20! (OR IT IS MARKED AS WRONG)
-%h = 5
-%h = 19
-%h = 47
-%h = -1
-
-% Now compute the volume. Using conditional statments you will want to first check the height makes sense,
-% and then solve the volume depending on what portion of the tank has been filled.
-% Make sure that your volume is stored in the variable v! (OR IT WILL BE MARKED AS WRONG)
-% You may find it more convenient to move v around in you code, it is only given here to indicate what variable to use.
-%v =
-
-v_cyl = @(h,r_bot) pi*r_bot^2*h;
-v_truncone = @(h_cone,r_bot) 1/3*pi*h_cone*(r_bot^2+r_bot*((h_cone+16.625)/1.33)+((h_cone+16.625)/1.33)^2);
-
-if h > 19
- v = v_cyl(19,r_bot)+v_truncone(h_cone,r_bot);
-else
- v = v_cyl(h,r_bot);
-end
-
-fprintf(1,'Volume of Tank: %6.2f\n',v) \ No newline at end of file