Assign dates with number
1 view (last 30 days)
I have the following code
% read from excel file
Fuels_Data=cell2mat(Data(2:17545))' % Fuels_Data: 1X17544
Ch_Day=367 % Ch_Day corresponds=367 6/1/2020, Ch_Day=368 corresponds 7/1/2020, etc.
What I want is the following: e.g. To have the variable date, to put the date I want (eg date= "6/1/2020") and the code to define that Ch_Day = 367. How can this happen?
Your help is important.
Benjamin Thompson on 2 Mar 2022
See the help article "Dates and Time" for information about working with dates and times in MATLAB. There is a function called days that can quickly calculate duration in days from day 0 in your "days" unit. Then if you have more specific questions please post your code and sample input file.