summaryrefslogtreecommitdiff
path: root/Functions/days/days.m
diff options
context:
space:
mode:
authorChristian Kolset <christian@kolset.com>2021-07-09 23:50:15 -0600
committerChristian Kolset <christian@kolset.com>2021-07-09 23:50:15 -0600
commit0f1c29b7c59ad4499168e0f521cf0522d01cc594 (patch)
tree7a3265be4569dd6dd4bc3809232cd8a11f13e788 /Functions/days/days.m
parent34dd12861a9a90bf88ee9abc6d8398f93f1a7b01 (diff)
Added Functions and Scripts
Diffstat (limited to 'Functions/days/days.m')
-rw-r--r--Functions/days/days.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Functions/days/days.m b/Functions/days/days.m
new file mode 100644
index 0000000..87163b7
--- /dev/null
+++ b/Functions/days/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