summaryrefslogtreecommitdiff
path: root/Functions/days.m
diff options
context:
space:
mode:
authorChristian Kolset <christian.kolset@gmail.com>2024-12-21 19:50:20 +0100
committerChristian Kolset <christian.kolset@gmail.com>2024-12-21 19:50:20 +0100
commit8b711a92ed5d955e88cdc5e625df9b2a547731a0 (patch)
treeb03ba4314b8a45ed44858f7216d4931834beb2ee /Functions/days.m
parentb0425f98abdb566ba66bf593b8e66dbc4f5a4d95 (diff)
re-organized files
Diffstat (limited to 'Functions/days.m')
-rw-r--r--Functions/days.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Functions/days.m b/Functions/days.m
new file mode 100644
index 0000000..87163b7
--- /dev/null
+++ b/Functions/days.m
@@ -0,0 +1,22 @@
+function nd = days(mo, da, leap)
+%days - Counts days elapsed in the year.
+%
+% days(<months>, <days>, <leap>) determines the days elapsed in a year
+% based on the current date. This will include the current day.
+% Months (1-12),
+% Example: August 28, no leap year
+% days(8,28,0)
+
+daysPeM=[0 31 59 90 120 151 181 212 243 273 304 334]; % cummulative days prior each month.
+
+nd = daysPeM(mo) + da;
+
+if leap == 1 & mo >= 3
+ nd = nd + 1;
+end
+end
+
+
+% MECH 105: Homework 4 - Part 1
+% Author: Christian Kolset
+% Date: 5.21.21 \ No newline at end of file