I have stock price data with related dates stored in column vectors with data in MATLAB format.
I often need to do cycles or search queries on dates that I currently understand using "external accounting", for example
for i = 1:length(dates)
thisDate = dates(i)
end
or worse
iDate = find(dates == thisDate, 1)
I usually have to do very similar operations, so I would like to create a date object that encapsulates this function for me. This is trivial to do using public properties like
dates.datenum(i)
dates.datestr(i)
dates.findOneYearEarlier(i)
and etc.
BUT
I need to have access to the vector directly in order to maintain compatibility.
Thus, direct access to my date object should result in a valid date. Example:
dates(i) == 730910 % right now
dates.datenum(i) == 730910 % how I'm able to do it
I need to work at the same time. Is there any way to do this in matlab?
, , :
, , , . , , ...
, , . , , .
-, , .
!